The storybook generator we invoked earlier also generated some tests. Let's try them out!
- Take advantage of the e2e tests Nx generated earlier to test your app
-
Our previous command generated tests with stories as well. Let's run them:
nx storybook store-ui-shared
and in another terminalnx test-storybook store-ui-shared
- The tests should fail
- The tests should fail
-
Open
libs/store/ui-shared/src/lib/header/header.stories.tsx
and give the title a value.🐳 Hint
```tsargs: { title: 'Welcome to Board Game Hoard'; }
</details> <br />
-
Now fix the test to check if it contains that value
🐳 Hint
```tsexpect(canvas.getByText(/Welcome to Board Game Hoard/gi)).toBeTruthy();
</details> <br />
-
Re-run the tests
-
Inspect what changed from the last time you committed, then commit your changes