Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: exports #185

Merged
merged 1 commit into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/markup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export * from "./common"
export * from "./markup-components"
export * from "./react-components/ory/helpers/types"
export * from "./theme"
export * from "./ui"
export * as locales from "./locales"
1 change: 1 addition & 0 deletions src/react.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright © 2023 Ory Corp
// SPDX-License-Identifier: Apache-2.0

export * from "./ui"
export * from "./common"
export * from "./react-components"
export * from "./react-components/ory/helpers/types"
Expand Down
10 changes: 8 additions & 2 deletions src/ui/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
// SPDX-License-Identifier: Apache-2.0

import { UiNode } from "@ory/client"
import { filterNodesByGroups, FilterNodesByGroups, getNodeLabel } from "./index"
import {
filterNodesByGroups,
FilterNodesByGroups,
getNodeLabelText,
} from "./index"
import nodes from "./fixtures/nodes.json"

describe("generic helpers", () => {
Expand Down Expand Up @@ -313,6 +317,8 @@ describe("generic helpers", () => {
})

test("getNodeLabel", () => {
expect((nodes as unknown as UiNode[]).map(getNodeLabel)).toMatchSnapshot()
expect(
(nodes as unknown as UiNode[]).map(getNodeLabelText),
).toMatchSnapshot()
})
})
4 changes: 1 addition & 3 deletions src/ui/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ import type {
UiNode,
UiNodeAnchorAttributes,
UiNodeAttributes,
UiNodeGroupEnum,
UiNodeImageAttributes,
UiNodeInputAttributes,
UiNodeInputAttributesTypeEnum,
UiNodeScriptAttributes,
UiNodeTextAttributes,
} from "@ory/client"
Expand All @@ -19,7 +17,7 @@ import type {
* @param node
* @return label
*/
export const getNodeLabel = (node: UiNode): string => {
export const getNodeLabelText = (node: UiNode): string => {
const attributes = node.attributes
if (isUiNodeAnchorAttributes(attributes)) {
return attributes.title.text
Expand Down
Loading