- ) : null
-}
-
-export const PasskeySection = (flow: SelfServiceFlow): JSX.Element | null => {
- return hasPasskey(flow.ui.nodes) ? (
-
-
+ >
) : null
}
@@ -63,33 +90,26 @@ export const PasskeyLoginSection = (
flow: SelfServiceFlow,
): JSX.Element | null => {
return hasPasskey(flow.ui.nodes) ? (
-
+ <>
-
- ) : null
-}
-
-export const DefaultLoginSection = (
- flow: SelfServiceFlow,
-): JSX.Element | null => {
- return hasDefault(flow.ui.nodes) ? (
-
-
-
+
+
+
+ >
) : null
}
@@ -98,27 +118,36 @@ export const PasswordlessLoginSection = (
): JSX.Element | null => {
if (hasWebauthn(flow.ui.nodes)) {
return (
-
-
+ >
)
}
diff --git a/src/react-components/ory/sections/profile-section.tsx b/src/react-components/ory/sections/profile-section.tsx
index b053664a..62ef7322 100644
--- a/src/react-components/ory/sections/profile-section.tsx
+++ b/src/react-components/ory/sections/profile-section.tsx
@@ -17,7 +17,7 @@ export const ProfileSettingsSection = ({
return (
) : null
}
+
+export const ProfileLoginSection = (
+ flow: SelfServiceFlow,
+): JSX.Element | null => {
+ return hasProfile(flow.ui.nodes) ? (
+
+
+
+
+ ) : null
+}
diff --git a/src/react-components/ory/sections/registration-section.tsx b/src/react-components/ory/sections/registration-section.tsx
index 19b9bd3c..0d6ad7b3 100644
--- a/src/react-components/ory/sections/registration-section.tsx
+++ b/src/react-components/ory/sections/registration-section.tsx
@@ -19,7 +19,7 @@ export const RegistrationSection = ({
filter={{
nodes: nodes,
groups: ["password"],
- excludeAttributes: "submit,hidden",
+ excludeAttributeTypes: "submit,hidden",
}}
/>
@@ -27,7 +27,7 @@ export const RegistrationSection = ({
filter={{
nodes: nodes,
groups: ["password"],
- excludeAttributes: "hidden",
+ excludeAttributeTypes: "hidden",
attributes: "submit",
}}
/>
diff --git a/src/react-components/ory/sections/totp-settings-section.tsx b/src/react-components/ory/sections/totp-settings-section.tsx
index f483f763..ba4a77f2 100644
--- a/src/react-components/ory/sections/totp-settings-section.tsx
+++ b/src/react-components/ory/sections/totp-settings-section.tsx
@@ -21,7 +21,7 @@ export const TOTPSettingsSection = ({
return hasTotp(flow.ui.nodes) ? (
!!$profile && flowType === "registration"
+ const canShowProfile = () => !!$profile && hasProfile(flow.ui.nodes)
// the current flow is a two factor flow if the user is logged in and has any of the second factor methods enabled.
const isTwoFactor = () =>
@@ -307,7 +311,7 @@ export const UserAuthCard = ({
nodes: flow.ui.nodes,
groups: "totp",
withoutDefaultGroup: true,
- excludeAttributes: "submit",
+ excludeAttributeTypes: "submit",
}}
/>
{subtitle && {subtitle}}
+
+
{$oidc && (
<>
-
{$oidc}
+
+ >
+ )}
+
+ {$twoStep && (
+ <>
+
+ {$twoStep}
+
+ >
+ )}
+
+ {canShowPasskey() && (
+ <>
+
+ {$passkey}
+
>
)}
+
{$code && (
<>
-
{$code}
>
)}
+
{$flow && !isTwoFactor() && (
<>
-
{$flow}
- {showLoggedAccount && }
>
)}
+
{isTwoFactor() && (
<>
{twoFactorFlows()}
- {showLoggedAccount && }
- >
- )}
-
- {canShowPasskey() && (
- <>
-
-
- {$passkey}
-
>
)}
{canShowPasswordless() && (
<>
-
-
{$profile}
>
)}
+ {showLoggedAccount && }
+
{message && MessageSection(message)}
diff --git a/src/ui/index.test.ts b/src/ui/index.test.ts
index d6d396cd..ad7c448a 100644
--- a/src/ui/index.test.ts
+++ b/src/ui/index.test.ts
@@ -251,7 +251,7 @@ describe("generic helpers", () => {
opts: {
groups: "webauthn",
withoutDefaultGroup: true,
- excludeAttributes: "script",
+ excludeAttributeTypes: "script",
},
expected: [
{
diff --git a/src/ui/index.ts b/src/ui/index.ts
index c86286df..19750ae3 100644
--- a/src/ui/index.ts
+++ b/src/ui/index.ts
@@ -125,7 +125,8 @@ export interface FilterNodesByGroups {
withoutDefaultGroup?: boolean
attributes?: string[] | string
withoutDefaultAttributes?: boolean
- excludeAttributes?: string[] | string
+ excludeAttributeTypes?: string[] | string
+ excludeAttributeValues?: string[] | string
}
/**
@@ -146,14 +147,15 @@ export const filterNodesByGroups = ({
withoutDefaultGroup,
attributes,
withoutDefaultAttributes,
- excludeAttributes,
+ excludeAttributeTypes,
+ excludeAttributeValues,
}: FilterNodesByGroups) => {
const search = (s: string[] | string | undefined) =>
typeof s === "string" ? s.split(",") : s
return nodes.filter(({ group, attributes: attr }) => {
// if we have not specified any group or attribute filters, return all nodes
- if (!groups && !attributes && !excludeAttributes) return true
+ if (!groups && !attributes && !excludeAttributeTypes) return true
const g = search(groups) ?? []
if (!withoutDefaultGroup) {
@@ -174,16 +176,28 @@ export const filterNodesByGroups = ({
}
// filter the attributes to exclude
- const ea = search(excludeAttributes) ?? []
+ const eat = search(excludeAttributeTypes) ?? []
+ const eav = search(excludeAttributeValues) ?? []
const filterGroup = groups ? g.includes(group) : true
const filterAttributes = attributes
? a.includes(getNodeInputType(attr))
: true
- const filterExcludeAttributes = excludeAttributes
- ? !ea.includes(getNodeInputType(attr))
+ const filterExcludeAttributeTypes = excludeAttributeTypes
+ ? !eat.includes(getNodeInputType(attr))
+ : true
+ const filterExcludeAttributeValue = excludeAttributeValues
+ ? !eav.includes(getNodeInputValue(attr))
: true
- return filterGroup && filterAttributes && filterExcludeAttributes
+ return filterGroup && filterAttributes && filterExcludeAttributeTypes && filterExcludeAttributeValue
})
}
+
+export const getNodeInputValue = (attr?: UiNodeAttributes) => {
+ if (!attr) return ""
+ if (isUiNodeInputAttributes(attr)) {
+ return String(attr.value)
+ }
+ return ""
+}
From 330df0aefca7fd967e7752e2d0f398fe72fed3a4 Mon Sep 17 00:00:00 2001
From: aeneasr <3372410+aeneasr@users.noreply.github.com>
Date: Mon, 10 Jun 2024 10:51:00 +0200
Subject: [PATCH 3/5] chore: synchronize workspaces
---
src/react-components/ory/helpers/utils.ts | 5 ++---
.../ory/sections/auth-code-section.tsx | 2 +-
src/react-components/ory/sections/link-section.tsx | 2 +-
src/react-components/ory/sections/login-section.tsx | 12 ++++++------
.../ory/sections/passwordless-section.tsx | 10 +++++-----
src/react-components/ory/user-auth-card.tsx | 7 +++++--
6 files changed, 20 insertions(+), 18 deletions(-)
diff --git a/src/react-components/ory/helpers/utils.ts b/src/react-components/ory/helpers/utils.ts
index 02e278ce..5aba42c8 100644
--- a/src/react-components/ory/helpers/utils.ts
+++ b/src/react-components/ory/helpers/utils.ts
@@ -8,12 +8,11 @@ export const hasGroup = (group: string) => (nodes: UiNode[]) =>
export const hasOidc = hasGroup("oidc")
export const hasPassword = hasGroup("password")
-export const hasIdentityDiscovery = hasGroup("identity_discovery")
-export const hasDefault = hasGroup("default")
+export const hasDefault = hasGroup("default")
export const hasProfile = hasGroup("profile")
export const hasWebauthn = hasGroup("webauthn")
export const hasPasskey = hasGroup("passkey")
-export const hasTwoStep = hasGroup("two_step")
+export const hasIdentifierFirst = hasGroup("identifier_first")
export const hasLookupSecret = hasGroup("lookup_secret")
export const hasTotp = hasGroup("totp")
export const hasCode = hasGroup("code")
diff --git a/src/react-components/ory/sections/auth-code-section.tsx b/src/react-components/ory/sections/auth-code-section.tsx
index e072c4c7..9a9c73ca 100644
--- a/src/react-components/ory/sections/auth-code-section.tsx
+++ b/src/react-components/ory/sections/auth-code-section.tsx
@@ -22,7 +22,7 @@ export const AuthCodeSection = ({
(
diff --git a/src/react-components/ory/sections/login-section.tsx b/src/react-components/ory/sections/login-section.tsx
index 4562456a..f7f73de3 100644
--- a/src/react-components/ory/sections/login-section.tsx
+++ b/src/react-components/ory/sections/login-section.tsx
@@ -5,7 +5,7 @@ import { FormattedMessage } from "react-intl"
import { gridStyle } from "../../../theme"
import { ButtonLink, CustomHref } from "../../button-link"
import { FilterFlowNodes } from "../helpers/filter-flow-nodes"
-import { hasPassword, hasTwoStep } from "../helpers/utils"
+import { hasPassword, hasIdentifierFirst } from "../helpers/utils"
import { SelfServiceFlow } from "../helpers/types"
export interface LoginSectionProps {
@@ -13,23 +13,23 @@ export interface LoginSectionProps {
forgotPasswordURL?: CustomHref | string
}
-export const TwoStepLoginSection = (
+export const IdentifierFirstLoginSection = (
flow: SelfServiceFlow,
): JSX.Element | null => {
const nodes = flow.ui.nodes
- return hasTwoStep(nodes) ? (
+ return hasIdentifierFirst(nodes) ? (
@@ -46,7 +46,7 @@ export const LoginSection = ({
diff --git a/src/react-components/ory/sections/passwordless-section.tsx b/src/react-components/ory/sections/passwordless-section.tsx
index 1c78e7c5..61f0be51 100644
--- a/src/react-components/ory/sections/passwordless-section.tsx
+++ b/src/react-components/ory/sections/passwordless-section.tsx
@@ -6,7 +6,7 @@ import { SelfServiceFlow } from "../helpers/types"
import {
hasDefault,
hasPasskey,
- hasTwoStep,
+ hasIdentifierFirst,
hasWebauthn,
} from "../helpers/utils"
@@ -18,7 +18,7 @@ export const PasswordlessSection = (
{
Date: Thu, 20 Jun 2024 11:48:24 +0200
Subject: [PATCH 4/5] fix: include hidden passkey fields in form (#188)
---
.../ory/helpers/user-auth-form.tsx | 68 +++++-----
.../ory/sections/passwordless-section.tsx | 9 +-
.../ory/sections/profile-section.tsx | 34 ++---
src/react-components/ory/user-auth-card.tsx | 127 ++++++++++--------
src/ui/index.ts | 9 +-
5 files changed, 133 insertions(+), 114 deletions(-)
diff --git a/src/react-components/ory/helpers/user-auth-form.tsx b/src/react-components/ory/helpers/user-auth-form.tsx
index 52990a6f..2d85a3e7 100644
--- a/src/react-components/ory/helpers/user-auth-form.tsx
+++ b/src/react-components/ory/helpers/user-auth-form.tsx
@@ -69,19 +69,9 @@ export const UserAuthForm = ({
formFilterOverride,
className,
...props
-}: UserAuthFormProps): JSX.Element => (
-
-)
+ }}
+ onSubmit={submitHandler}
+ {...props}
+ >
+ <>
+ {/*always add csrf token and other hidden fields to form*/}
+
+ {children}
+ >
+
+ )
+}
diff --git a/src/react-components/ory/sections/passwordless-section.tsx b/src/react-components/ory/sections/passwordless-section.tsx
index 61f0be51..08a8c093 100644
--- a/src/react-components/ory/sections/passwordless-section.tsx
+++ b/src/react-components/ory/sections/passwordless-section.tsx
@@ -3,12 +3,7 @@ import { JSX } from "react"
import { gridStyle } from "../../../theme"
import { FilterFlowNodes } from "../helpers/filter-flow-nodes"
import { SelfServiceFlow } from "../helpers/types"
-import {
- hasDefault,
- hasPasskey,
- hasIdentifierFirst,
- hasWebauthn,
-} from "../helpers/utils"
+import { hasPasskey, hasWebauthn } from "../helpers/utils"
export const PasswordlessSection = (
flow: SelfServiceFlow,
@@ -55,7 +50,7 @@ export const PasskeySection = (flow: SelfServiceFlow): JSX.Element | null => {
{
return hasProfile(flow.ui.nodes) ? (
-
-
-
-
+
+
+
+
) : null
}
diff --git a/src/react-components/ory/user-auth-card.tsx b/src/react-components/ory/user-auth-card.tsx
index 65a148c1..f679c4fb 100644
--- a/src/react-components/ory/user-auth-card.tsx
+++ b/src/react-components/ory/user-auth-card.tsx
@@ -84,28 +84,29 @@ export type UserAuthCardProps = {
includeScripts?: boolean
className?: string
} & UserAuthFormAdditionalProps &
- (
- | {
- flow: LoginFlow
- flowType: "login"
- additionalProps?: LoginSectionAdditionalProps
- }
- | {
- flow: RegistrationFlow
- flowType: "registration"
- additionalProps?: RegistrationSectionAdditionalProps
- }
- | {
- flow: RecoveryFlow
- flowType: "recovery"
- additionalProps?: RecoverySectionAdditionalProps
- }
- | {
- flow: VerificationFlow
- flowType: "verification"
- additionalProps?: VerificationSectionAdditionalProps
- }
- )
+ FlowProps
+
+type FlowProps =
+ | {
+ flow: LoginFlow
+ flowType: "login"
+ additionalProps?: LoginSectionAdditionalProps
+ }
+ | {
+ flow: RegistrationFlow
+ flowType: "registration"
+ additionalProps?: RegistrationSectionAdditionalProps
+ }
+ | {
+ flow: RecoveryFlow
+ flowType: "recovery"
+ additionalProps?: RecoverySectionAdditionalProps
+ }
+ | {
+ flow: VerificationFlow
+ flowType: "verification"
+ additionalProps?: VerificationSectionAdditionalProps
+ }
/**
* UserAuthCard renders a login, registration, verification or recovery flow
@@ -114,31 +115,33 @@ export type UserAuthCardProps = {
* @returns JSX.Element
*/
export const UserAuthCard = ({
- flow,
title,
subtitle,
- flowType,
additionalProps,
cardImage,
onSubmit,
includeScripts,
className,
+ flow,
+ flowType,
}: UserAuthCardProps): JSX.Element => {
+ // Safe, because we know that the props are of the correct type
+ const flowProps = { flow, flowType, additionalProps } as FlowProps
const intl = useIntl()
if (includeScripts) {
- useScriptNodes({ nodes: flow.ui.nodes })
+ useScriptNodes({ nodes: flowProps.flow.ui.nodes })
}
if (!title) {
- switch (flowType) {
+ switch (flowProps.flowType) {
case "login":
- if (flow.refresh) {
+ if (flowProps.flow.refresh) {
title = intl.formatMessage({
id: "login.title-refresh",
defaultMessage: "Confirm it's you",
})
- } else if (flow.requested_aal === "aal2") {
+ } else if (flowProps.flow.requested_aal === "aal2") {
title = intl.formatMessage({
id: "login.title-aal2",
defaultMessage: "Two-Factor Authentication",
@@ -171,9 +174,9 @@ export const UserAuthCard = ({
}
}
if (!subtitle) {
- switch (flowType) {
+ switch (flowProps.flowType) {
case "login":
- if (flow.oauth2_login_request) {
+ if (flowProps.flow.oauth2_login_request) {
subtitle = intl.formatMessage(
{
id: "login.subtitle-oauth2",
@@ -181,14 +184,14 @@ export const UserAuthCard = ({
},
{
clientName:
- flow.oauth2_login_request.client?.client_name ??
- flow.oauth2_login_request.client?.client_uri,
+ flowProps.flow.oauth2_login_request.client?.client_name ??
+ flowProps.flow.oauth2_login_request.client?.client_uri,
},
)
}
break
case "registration":
- if (flow.oauth2_login_request) {
+ if (flowProps.flow.oauth2_login_request) {
subtitle = intl.formatMessage(
{
id: "registration.subtitle-oauth2",
@@ -196,8 +199,8 @@ export const UserAuthCard = ({
},
{
clientName:
- flow.oauth2_login_request.client?.client_name ??
- flow.oauth2_login_request.client?.client_uri,
+ flowProps.flow.oauth2_login_request.client?.client_name ??
+ flowProps.flow.oauth2_login_request.client?.client_uri,
},
)
}
@@ -228,20 +231,20 @@ export const UserAuthCard = ({
// we want the login section to handle passwordless as well when we have a 2FA screen.
const canShowPasswordless = () =>
!!$passwordlessWebauthn &&
- (!isLoggedIn(flow as LoginFlow) || flowType === "registration")
+ (!isLoggedIn(flow as LoginFlow) || flowProps.flowType === "registration")
// passkey can be shown if the user is not logged in (e.g. exclude 2FA screen) or if the flow is a registration flow.
// we want the login section to handle passwordless as well when we have a 2FA screen.
const canShowPasskey = () =>
!!$passkey &&
- (!isLoggedIn(flow as LoginFlow) || flowType === "registration")
+ (!isLoggedIn(flow as LoginFlow) || flowProps.flowType === "registration")
const canShowProfile = () => !!$profile && hasProfile(flow.ui.nodes)
// the current flow is a two factor flow if the user is logged in and has any of the second factor methods enabled.
const isTwoFactor = () =>
- flowType === "login" &&
- isLoggedIn(flow) &&
+ flowProps.flowType === "login" &&
+ isLoggedIn(flowProps.flow) &&
(hasTotp(flow.ui.nodes) ||
hasWebauthn(flow.ui.nodes) ||
hasPasskey(flow.ui.nodes) ||
@@ -358,7 +361,7 @@ export const UserAuthCard = ({
)) // only map the divider if the index is greater than 0 - more than one flow
- switch (flowType) {
+ switch (flowProps.flowType) {
case "login":
$passwordlessWebauthn = PasswordlessLoginSection(flow)
$passkey = PasskeyLoginSection(flow)
@@ -372,7 +375,7 @@ export const UserAuthCard = ({
...additionalProps,
})
- if (isLoggedIn(flow) && additionalProps?.logoutURL) {
+ if (isLoggedIn(flowProps.flow) && flowProps.additionalProps?.logoutURL) {
message = {
text: intl.formatMessage({
id: "login.logout-label",
@@ -383,9 +386,9 @@ export const UserAuthCard = ({
defaultMessage: "Logout",
}),
dataTestId: "logout-link",
- url: additionalProps.logoutURL,
+ url: flowProps.additionalProps.logoutURL,
}
- } else if (additionalProps?.signupURL) {
+ } else if (flowProps.additionalProps?.signupURL) {
message = {
text: intl.formatMessage({
id: "login.registration-label",
@@ -395,7 +398,7 @@ export const UserAuthCard = ({
id: "login.registration-button",
defaultMessage: "Sign up",
}),
- url: additionalProps.signupURL,
+ url: flowProps.additionalProps.signupURL,
dataTestId: "signup-link",
}
}
@@ -409,13 +412,13 @@ export const UserAuthCard = ({
$flow = RegistrationSection({
nodes: flow.ui.nodes,
})
- if (additionalProps?.loginURL) {
+ if (flowProps.additionalProps?.loginURL) {
message = {
text: intl.formatMessage({
id: "registration.login-label",
defaultMessage: "Already have an account?",
}),
- url: additionalProps.loginURL,
+ url: flowProps.additionalProps.loginURL,
buttonText: intl.formatMessage({
id: "registration.login-button",
defaultMessage: "Sign in",
@@ -429,7 +432,7 @@ export const UserAuthCard = ({
$flow = LinkSection({
nodes: flow.ui.nodes,
})
- if (additionalProps?.loginURL) {
+ if (flowProps.additionalProps?.loginURL) {
message = {
text: intl.formatMessage({
id: "recovery.login-label",
@@ -439,7 +442,7 @@ export const UserAuthCard = ({
id: "recovery.login-button",
defaultMessage: "Sign in",
}),
- url: additionalProps.loginURL,
+ url: flowProps.additionalProps.loginURL,
dataTestId: "cta-link",
}
}
@@ -448,7 +451,7 @@ export const UserAuthCard = ({
$flow = LinkSection({
nodes: flow.ui.nodes,
})
- if (additionalProps?.signupURL) {
+ if (flowProps.additionalProps?.signupURL) {
message = {
text: intl.formatMessage({
id: "verification.registration-label",
@@ -458,7 +461,7 @@ export const UserAuthCard = ({
id: "verification.registration-button",
defaultMessage: "Sign up",
}),
- url: additionalProps.signupURL,
+ url: flowProps.additionalProps.signupURL,
dataTestId: "cta-link",
}
}
@@ -476,7 +479,7 @@ export const UserAuthCard = ({
}
image={cardImage}
- data-testid={`${flowType}-auth-card`}
+ data-testid={`${flowProps.flowType}-auth-card`}
>
{subtitle &&
{subtitle}}
@@ -485,7 +488,10 @@ export const UserAuthCard = ({
{$oidc && (
<>
-
+
{$oidc}
@@ -494,7 +500,10 @@ export const UserAuthCard = ({
{$twoStep && (
<>
-
+
{$twoStep}
>
@@ -515,7 +524,10 @@ export const UserAuthCard = ({
{$code && (
<>
-
+
{$code}
>
@@ -527,7 +539,7 @@ export const UserAuthCard = ({
flow={flow}
submitOnEnter={true}
onSubmit={onSubmit}
- data-testid={`${flowType}-flow`}
+ data-testid={`${flowProps.flowType}-flow`}
>
{$flow}
@@ -572,7 +584,10 @@ export const UserAuthCard = ({
{canShowProfile() && (
<>
-
+
{$profile}
>
diff --git a/src/ui/index.ts b/src/ui/index.ts
index 19750ae3..94f1a5c5 100644
--- a/src/ui/index.ts
+++ b/src/ui/index.ts
@@ -148,7 +148,7 @@ export const filterNodesByGroups = ({
attributes,
withoutDefaultAttributes,
excludeAttributeTypes,
- excludeAttributeValues,
+ excludeAttributeValues,
}: FilterNodesByGroups) => {
const search = (s: string[] | string | undefined) =>
typeof s === "string" ? s.split(",") : s
@@ -190,7 +190,12 @@ export const filterNodesByGroups = ({
? !eav.includes(getNodeInputValue(attr))
: true
- return filterGroup && filterAttributes && filterExcludeAttributeTypes && filterExcludeAttributeValue
+ return (
+ filterGroup &&
+ filterAttributes &&
+ filterExcludeAttributeTypes &&
+ filterExcludeAttributeValue
+ )
})
}
From 4a79dd7cb9a0aa40d37ef2cecdc3f8753dd00e3b Mon Sep 17 00:00:00 2001
From: Jonas Hungershausen
Date: Tue, 25 Jun 2024 13:32:39 +0200
Subject: [PATCH 5/5] fix: tests
---
src/react-components/ory/user-auth-card.spec.tsx | 6 ++----
src/react-components/tests/translations.spec.ts | 4 +---
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/src/react-components/ory/user-auth-card.spec.tsx b/src/react-components/ory/user-auth-card.spec.tsx
index 58edf54e..02fde1db 100644
--- a/src/react-components/ory/user-auth-card.spec.tsx
+++ b/src/react-components/ory/user-auth-card.spec.tsx
@@ -248,7 +248,7 @@ test("ory auth card login refresh flow", async ({ mount }) => {
/>,
)
- await expect(component).toContainText("You're logged in as:")
+ await expect(component).toContainText("You are using:")
await expect(component).toContainText("johndoe@acme.com")
})
@@ -416,7 +416,5 @@ test("ory auth card login two factor confirmation", async ({ mount }) => {
expect(identifier).not.toBeNull()
expect(String(identifier.value)).toContain("@ory.sh")
- await expect(component).toContainText(
- `You're logged in as:${identifier.value}`,
- )
+ await expect(component).toContainText(`You are using:${identifier.value}`)
})
diff --git a/src/react-components/tests/translations.spec.ts b/src/react-components/tests/translations.spec.ts
index 924c0d7d..c794e5ba 100644
--- a/src/react-components/tests/translations.spec.ts
+++ b/src/react-components/tests/translations.spec.ts
@@ -35,11 +35,9 @@ test("language keys and templates match", async ({ templates }) => {
}
await test.step("Checking template strings", () => {
- Object.entries(supportedLanguages).forEach(([language, translation]) => {
- console.log(`Checking ${language} template strings`)
+ Object.entries(supportedLanguages).forEach(([, translation]) => {
Object.entries(templates).forEach(([key, templateStrings]) => {
for (const templateString of templateStrings) {
- console.log(`Checking ${language} ${key} ${templateString}`)
expect(
translation[key as keyof typeof supportedLanguages.en],
).toContain(templateString)