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

tests:Update UI tests to pass with mock data #35

Merged
merged 2 commits into from
Nov 25, 2021
Merged

Conversation

rsanteri
Copy link
Contributor

@rsanteri rsanteri commented Nov 17, 2021

Requirements for a pull request

  • Unit tests related to the change have been updated
  • Documentation related to the change has been updated

Description of the Change

Update current full UI tests to pass with some mocked data. These tests were initially planned for e2e testing, but they are currently not run by any CI. We should consider if they are useful at all since UI have quite a coverage with component tests.

Alternate Designs

Possible Drawbacks

Verification Process

Copy link
Collaborator

@obgibson obgibson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests all pass now!

When I run yarn test:components. How do I get it to run all of the tests? I had to select each test file separately and run each one. I am used to seeing a play icon to run them all.

});
});

it('Debug - Test that feature flags are rendered', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to have the Debug - in the test description. The describe description already has it. The output looks like

    ✓ Debug - Test that feature flags are rendered (3591ms)
    ✓ Debug - Test network logging and discard logs (2417ms)
    ✓ Debug - Test network logging and download logs (1137ms)

I also like to have the description as the end of a sentence starting with "it". e.g. it("renders feature flags")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed

@rsanteri
Copy link
Contributor Author

Tests all pass now!

When I run yarn test:components. How do I get it to run all of the tests? I had to select each test file separately and run each one. I am used to seeing a play icon to run them all.

Unfortunately cypress component tests doesn't have that at least yet. yarn test:components open interactive mode which is ideal when creating new tests or debugging single failing test. Use yarn test:components:run to run all tests in command line. (yarn test and yarn test:ci after #37)

@rsanteri rsanteri merged commit 162d31e into master Nov 25, 2021
@rsanteri rsanteri deleted the tests/update-ui-test branch November 25, 2021 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants