fix: group Connection Info's full-width OAuth fields above the token rows
Client ID sat third in OAuth Details, between Status and Client registration, so its label-over-value block interrupted the run of inline two-column rows and broke the scan down the label column for everything after it. Access Token and ID Token already used that layout, at the bottom. Moved Client ID and Auth URL down to sit with them: the inline rows now run Protocol, Status, Client registration, IdP session, Scopes, and the full-width fields follow as one group — Auth URL, Client ID, Access Token, ID Token — so Client ID is directly above the only other field a reader sees laid out the same way. A test asserts the order off the DOM rather than each field's presence, since order is the property; putting Client ID back in its old slot fails it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GfHQ8vMm5NBgzbUJ6UwxmB Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
parent
82b13a1a12
commit
664c9f8800
1 changed files with 68 additions and 11 deletions
|
|
@ -625,6 +625,57 @@ describe("ConnectionInfoContent", () => {
|
|||
}
|
||||
});
|
||||
|
||||
it("groups the full-width fields at the end, Client ID directly above Access Token", () => {
|
||||
renderWithMantine(
|
||||
<ConnectionInfoContent
|
||||
initializeResult={fullResult}
|
||||
clientCapabilities={fullClientCaps}
|
||||
transport="streamable-http"
|
||||
oauth={{
|
||||
protocol: "standard",
|
||||
authorized: true,
|
||||
clientId: "http://127.0.0.1:8093/client-metadata.json",
|
||||
clientRegistrationKind: "cimd",
|
||||
authUrl: "https://auth.example.com/authorize",
|
||||
scopes: ["mcp"],
|
||||
accessToken: "token-123",
|
||||
}}
|
||||
/>,
|
||||
);
|
||||
|
||||
// Order is the assertion, so read the labels off the DOM rather than
|
||||
// checking each is merely present: the inline two-column rows come first,
|
||||
// then every label-over-value field together. Interleaving them is what
|
||||
// this guards against — it broke the scan down the label column, and the
|
||||
// tokens already used the full-width layout at the bottom.
|
||||
const order = [
|
||||
"Client registration",
|
||||
"Scopes",
|
||||
"Auth URL",
|
||||
"Client ID",
|
||||
"Access Token",
|
||||
];
|
||||
const positions = order.map((label) => {
|
||||
const node = screen.getAllByText(label)[0];
|
||||
expect(node).toBeInTheDocument();
|
||||
return (
|
||||
node.compareDocumentPosition(screen.getAllByText("Protocol")[0]) &
|
||||
Node.DOCUMENT_POSITION_PRECEDING
|
||||
);
|
||||
});
|
||||
expect(positions.every(Boolean)).toBe(true);
|
||||
|
||||
const labelNode = (label: string) => screen.getAllByText(label)[0];
|
||||
for (let i = 0; i < order.length - 1; i++) {
|
||||
const earlier = labelNode(order[i]);
|
||||
const later = labelNode(order[i + 1]);
|
||||
expect(
|
||||
earlier.compareDocumentPosition(later) &
|
||||
Node.DOCUMENT_POSITION_FOLLOWING,
|
||||
).toBeTruthy();
|
||||
}
|
||||
});
|
||||
|
||||
it("renders EMA idp session when provided", () => {
|
||||
renderWithMantine(
|
||||
<ConnectionInfoContent
|
||||
|
|
|
|||
Loading…
Reference in a new issue