Skip to content

Commit 08e536b

Browse files
fix: elements examples (ory#1342)
Co-authored-by: tomekpapiernik <[email protected]>
1 parent 8fc5108 commit 08e536b

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

docs/kratos/bring-your-own-ui/15_custom-ui-ory-elements.mdx

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,29 +52,59 @@ Follow these steps to get the sample application code and run it on your machine
5252
git clone --depth 1 [email protected]:ory/elements.git
5353
cd elements
5454
npm run initialize
55+
npm run build:clean
5556
cd examples/react-spa
5657
```
5758
59+
Running the application outside the `ory/elements` repository:
60+
61+
```shell
62+
git clone --depth 1 [email protected]:ory/elements.git
63+
cp -r elements/examples/react-spa .
64+
cd react-spa
65+
npm i @ory/elements-react @ory/client @ory/elements-test
66+
```
67+
5868
</TabItem>
5969
<TabItem value="preact" label="Preact">
6070
6171
```shell
6272
git clone --depth 1 [email protected]:ory/elements.git
6373
cd elements
6474
npm run initialize
75+
npm run build:clean
6576
cd examples/preact-spa
6677
```
6778
79+
Running the application outside the `ory/elements` repository:
80+
81+
```shell
82+
git clone --depth 1 [email protected]:ory/elements.git
83+
cp -r elements/examples/preact-spa .
84+
cd preact-spa
85+
npm i @ory/elements-preact @ory/client @ory/elements-test
86+
```
87+
6888
</TabItem>
6989
<TabItem value="nextjs" label="Next.js">
7090
7191
```shell
7292
git clone --depth 1 [email protected]:ory/elements.git
7393
cd elements
7494
npm run initialize
95+
npm run build:clean
7596
cd examples/nextjs-spa
7697
```
7798
99+
Running the application outside the `ory/elements` repository:
100+
101+
```shell
102+
git clone --depth 1 [email protected]:ory/elements.git
103+
cp -r elements/examples/nextjs-spa .
104+
cd nextjs-spa
105+
npm i @ory/elements @ory/client @ory/elements-test
106+
```
107+
78108
</TabItem>
79109
</Tabs>
80110
````
@@ -470,6 +500,14 @@ losing access to a second authentication factor.
470500
</Tabs>
471501
```
472502

503+
## End-to-end tests
504+
505+
The examples provided by Ory Elements contain end-to-end tests through the `@ory/elements-test` library which provides convenience
506+
functions to test the login, registration, recovery, verification, and settings flows. In these examples, the tests are located in
507+
the `e2e` folder and are based on the [Playwright](https://playwright.dev/) library.
508+
509+
To run the tests, execute the `npm run test` command inside the example directory.
510+
473511
## Learn more
474512

475513
To learn more about Ory Elements, contribute to the project, and integrate with your application,

0 commit comments

Comments
 (0)