Skip to content
This repository has been archived by the owner on Apr 21, 2024. It is now read-only.

Latest commit

 

History

History
44 lines (30 loc) · 1.04 KB

11-TASK.md

File metadata and controls

44 lines (30 loc) · 1.04 KB

💻 Task 11 - e2e test the shared component

⏰  Estimated time: 5 minutes

The storybook generator we invoked earlier also generated some e2e tests. Let's try them out!

📚 Learning outcomes:

  • Take advantage of the e2e tests Nx generated earlier to test your app

🏋️‍♀️ Steps:

  1. Our previous command generated a new apps/store-ui-shared-e2e folder. Let's run them: nx e2e store-ui-shared-e2e
    • The tests should fail

  1. Open apps/store-ui-shared-e2e/src/integration/header/header.spec.ts and give the title a value:

    cy.visit(
      '/iframe.html?id=header--primary&args=title:BoardGameHoard'
    )

  1. Now add a test to check if it contains that value

    it('should show the title', () => {
      cy.get('header').contains('BoardGameHoard');
    });

  1. Re-run the tests

  1. Inspect what changed from the last time you committed, then commit your changes


➡️  Next task ➡️