Skip to content

Commit

Permalink
fix exports (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
hperl authored Mar 7, 2024
1 parent 172820d commit f4d6ed3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
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

0 comments on commit f4d6ed3

Please sign in to comment.