Skip to content

LuckBenLiu/braid-hidden-testing-issue

Repository files navigation

braid-hidden-testing-issue

Hidden component in braid-design-system seems cannot be mocked properly using BraidTestProvider by manipulating breakpoint.

Expectation

pnpm test src/App/App.spec.tsx should be successful.

Actual

pnpm test src/App/App.spec.tsx failed, saying the text is not visible.

Also, it looks like no matter what value I give to the breakpoint, the test will fail.

Received element is not visible:
      <div class="reset_base__14h31gj0 sprinkles_display_none_mobile__7n536n4w sprinkles_display_block_tablet__7n536n51" />

      14 |     );
      15 |
    > 16 |     expect(screen.getByText('Hello world (greater than tablet)')).toBeVisible();
         |                                                                   ^
      17 |   });
      18 | });
      19 |

      at Object.toBeVisible (src/App/App.spec.tsx:16:67)

About

Hidden component cannot be tested using `BraidTestProvider` with `breakpoint` field

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published