diff --git a/packages/elements-react/src/components/card/__tests__/card-two-step.spec.ts b/packages/elements-react/src/components/card/__tests__/card-two-step.spec.ts index 0812d280d..5c082cbcd 100644 --- a/packages/elements-react/src/components/card/__tests__/card-two-step.spec.ts +++ b/packages/elements-react/src/components/card/__tests__/card-two-step.spec.ts @@ -22,10 +22,10 @@ describe("CardTwoStep/utils", () => { }) describe("isChoosingMethod", () => { - test("should return true if a node has value 'profile:back'", () => { + test("should return true if a node has value 'screen=previous'", () => { const uiNodes: UiNode[] = [ { - attributes: { value: "profile:back" } as UiNodeAttributes, + attributes: { value: "previous", name: "screen" } as UiNodeAttributes, group: UiNodeGroupEnum.Default, } as UiNode, ] diff --git a/packages/elements-react/src/components/card/card-two-step.utils.ts b/packages/elements-react/src/components/card/card-two-step.utils.ts index f948ca141..71c4671d5 100644 --- a/packages/elements-react/src/components/card/card-two-step.utils.ts +++ b/packages/elements-react/src/components/card/card-two-step.utils.ts @@ -4,10 +4,14 @@ import { UiNode, UiNodeGroupEnum } from "@ory/client-fetch" export function isChoosingMethod(uiNodes: UiNode[]): boolean { + console.log(uiNodes) return ( uiNodes.some( (node) => - "value" in node.attributes && node.attributes.value === "profile:back", + "name" in node.attributes && + node.attributes.name === "screen" && + "value" in node.attributes && + node.attributes.value === "previous", ) || uiNodes.some( (node) =>