Update use of generated GraphQL types

This commit is contained in:
Quentin Gliech
2026-05-25 11:36:15 +02:00
parent ef6ecbbea0
commit 4bc2bc0e77
9 changed files with 28 additions and 14 deletions
@@ -22,6 +22,7 @@ describe("<OAuth2ClientDetail>", () => {
clientName: "Test Client",
clientUri: "https://client.org/logo.png",
tosUri: "https://client.org/tos",
logoUri: null,
policyUri: "https://client.org/policy",
redirectUris: ["https://client.org/"],
};
@@ -38,7 +39,7 @@ describe("<OAuth2ClientDetail>", () => {
const data = makeFragmentData(
{
...baseClient,
tosUri: undefined,
tosUri: null,
},
OAUTH2_CLIENT_FRAGMENT,
);
@@ -52,7 +53,7 @@ describe("<OAuth2ClientDetail>", () => {
const data = makeFragmentData(
{
...baseClient,
logoUri: undefined,
logoUri: null,
},
OAUTH2_CLIENT_FRAGMENT,
);
@@ -17,7 +17,11 @@ describe("<CompatSession />", () => {
id: "session-id",
deviceId: "abcd1234",
createdAt: "2023-06-29T03:35:17.451292+00:00",
finishedAt: null,
lastActiveIp: "1.2.3.4",
lastActiveAt: null,
humanName: null,
userAgent: null,
ssoLogin: {
id: "test-id",
redirectUri: "https://element.io/",
@@ -11,9 +11,9 @@ import { makeFragmentData } from "../../gql";
import Footer, { FRAGMENT } from "./Footer";
const Template: React.FC<{
tosUri?: string;
policyUri?: string;
imprint?: string;
tosUri: string | null;
policyUri: string | null;
imprint: string | null;
}> = ({ tosUri, policyUri, imprint }) => (
<Footer
siteConfig={makeFragmentData(
@@ -19,12 +19,17 @@ describe("<OAuth2Session />", () => {
scope:
"openid urn:matrix:org.matrix.msc2967.client:api:* urn:matrix:org.matrix.msc2967.client:device:abcd1234",
createdAt: "2023-06-29T03:35:17.451292+00:00",
finishedAt: null,
lastActiveIp: "1.2.3.4",
lastActiveAt: null,
userAgent: null,
humanName: null,
client: {
id: "test-id",
clientId: "test-client-id",
clientName: "Element",
clientUri: "https://element.io",
logoUri: null,
applicationType: "WEB" as Oauth2ApplicationType,
},
};
@@ -22,6 +22,7 @@ describe("<CompatSessionDetail>", () => {
lastActiveIp: "1.2.3.4",
lastActiveAt: "2023-07-29T03:35:17.451292+00:00",
userAgent: null,
humanName: null,
ssoLogin: {
id: "test-id",
redirectUri: "https://element.io",
@@ -23,6 +23,7 @@ describe("<OAuth2SessionDetail>", () => {
lastActiveAt: "2023-07-29T03:35:17.451292+00:00",
lastActiveIp: "1.2.3.4",
userAgent: null,
humanName: null,
client: {
id: "test-id",
clientId: "test-client-id",
@@ -12,7 +12,7 @@ import UserGreeting, { CONFIG_FRAGMENT, FRAGMENT } from "./UserGreeting";
const queryClient = new QueryClient();
const Template: React.FC<{
displayName?: string;
displayName: string | null;
mxid: string;
displayNameChangeAllowed: boolean;
}> = ({ displayName, mxid, displayNameChangeAllowed }) => {
+10 -6
View File
@@ -82,12 +82,16 @@ export const handlers = [
),
),
siteConfig: makeFragmentData(
{
displayNameChangeAllowed: true,
},
USER_GREETING_CONFIG_FRAGMENT,
),
siteConfig: {
planManagementIframeUri: null,
sessionLimit: null,
...makeFragmentData(
{
displayNameChangeAllowed: true,
},
USER_GREETING_CONFIG_FRAGMENT,
),
},
},
}),
),
@@ -37,7 +37,6 @@ describe("Account home page", () => {
return HttpResponse.json({
data: {
setDisplayName: {
__typename: "SetDisplayNamePayload",
status: "SET",
},
},
@@ -105,7 +104,6 @@ describe("Account home page", () => {
HttpResponse.json({
data: {
setDisplayName: {
__typename: "SetDisplayNamePayload",
status: "INVALID",
},
},