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

[Bug]: Not able to achieve 100% interaction tests coverage for specific components #499

Open
Manuela-Sousa opened this issue Jul 23, 2024 · 0 comments
Labels
bug Something isn't working needs triage

Comments

@Manuela-Sousa
Copy link

Manuela-Sousa commented Jul 23, 2024

Describe the bug

At the moment I´m trying to create interaction tests for several components in storybook. However i realized that for specific components (Checkbox, and Link) I´m not being able to achieve 100% test coverage even thought I´m sure I´m covering the specific scenario mentioned not being covered.
Example for link component: Code Line: text-decoration: ${props => (props.underline ? 'underline' : 'none')}; and Validation in test: expect(link).toHaveStyle('text-decoration: none solid rgb(40, 96, 215)');
Did anyone noticed this before? and also sometimes the results varies a lot not always giving the same coverage data even if the code is not changed.

To Reproduce

1 - Having a code line like this and create the validation test Example: Code Line: text-decoration: ${props => (props.underline ? 'underline' : 'none')}; and Validation in test: expect(link).toHaveStyle('text-decoration: none solid rgb(40, 96, 215)');
2 - Execute the test coverage command to check if the scenario appears covered

System

Storybook Environment Info:

  System:
    OS: Windows 11 10.0.22631
    CPU: (8) x64 Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz
  Binaries:
    Node: 20.11.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.22 - ~\AppData\Roaming\npm\yarn.CMD <----- active
    npm: 10.8.1 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (126.0.2592.113)
  npmPackages:
    @storybook/addon-a11y: ^8.1.11 => 8.2.4
    @storybook/addon-coverage: ^1.0.4 => 1.0.4
    @storybook/addon-essentials: ^8.1.11 => 8.1.11
    @storybook/addon-interactions: ^8.1.11 => 8.1.11
    @storybook/addon-links: ^8.1.11 => 8.1.11
    @storybook/addon-onboarding: ^8.1.11 => 8.1.11
    @storybook/blocks: ^8.1.11 => 8.1.11
    @storybook/react: ^8.1.11 => 8.1.11
    @storybook/react-vite: ^8.1.11 => 8.1.11
    @storybook/test: ^8.1.11 => 8.1.11
    @storybook/test-runner: ^0.19.0 => 0.19.0
    eslint-plugin-storybook: ^0.8.0 => 0.8.0
    storybook: ^8.1.11 => 8.2.4

Additional context

No response

@Manuela-Sousa Manuela-Sousa added bug Something isn't working needs triage labels Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

1 participant