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

test(snapshot): Migrate snapshot tests to storybook #5340

Merged

Conversation

Harkunwar
Copy link
Contributor

@Harkunwar Harkunwar commented Apr 29, 2023

This PR aims to migrate existing snapshot tests written in jest, and instead automates it using the existing storybook stories. The test are also run in Playwright now, instead of JSDOM, so it's more accurate.
#5329

AugustinMauroy and others added 30 commits April 15, 2023 10:17
Co-authored-by: Shanmughapriyan S <[email protected]>
Co-authored-by: Michael Esteban <[email protected]>
Co-authored-by: Claudio Wunder <[email protected]>
Migrate AnimatedPlaceholder component from nodejs.dev
and create a new Story.
chore: next lock to versin 13.2.0
Co-authored-by: Claudio Wunder <[email protected]>
Co-authored-by: Teja Sai Sandeep Reddy Konala <[email protected]>
Co-authored-by: Shanmughapriyan S <[email protected]>
Co-authored-by: Michael Esteban <[email protected]>
…mplates (nodejs#5294)

Co-authored-by: Shanmughapriyan S <[email protected]>
Co-authored-by: Manish Kumar ⛄ <[email protected]>
…ies (nodejs#5319

* chore: optimises tsconfig

* chiore: add missing dependencies

* chore: type storybook constants

* chore: styles moved styles to somewhere else

* chore: add global json type definition

* chore: i18n aria-label instead of sr-only

* chore: added open sans font family and space between imports

* chore: moved styles and fixed styles and updated banner stories

* fix: stylelint rules

* chore: updated tsconfig

* chore: fix tests

* fix: darkmodetoggle test

* chore: stories use index.stories.tsx
* chore: revert pnpm use plain npm

* fix: package.json

* chore: remove warnings and add node_env

* chore: cross-env

* fix: fix turbo pipelines

* chore: only cache certain files

* chore: turbo shouldn't care about coverage outputs

* chore: proper inputs and outputs for pipelines

* chore: do not store some outputs and updated inputs for lint

* chore: added prettier configs

* chore: remove console.info

* chore: updated inputs of all other entries
fix(package.json) lint:fix missing slashes
Co-authored-by: vasanth9 <cheepurupalli.vasanthkumar.com>
Co-authored-by: Shanmughapriyan S <[email protected]>
@ovflowd
Copy link
Member

ovflowd commented May 4, 2023

This PR got accidentally closed because the branch got deleted. Please feel free to reopen the PR.

@ovflowd ovflowd reopened this May 4, 2023
@vercel vercel bot temporarily deployed to Preview – nodejs-org-stories May 4, 2023 16:26 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org May 4, 2023 16:27 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org-stories May 4, 2023 16:46 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org May 4, 2023 16:47 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org May 4, 2023 16:53 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org-stories May 4, 2023 16:53 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org May 4, 2023 16:59 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org-stories May 4, 2023 17:00 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org May 4, 2023 17:09 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org-stories May 4, 2023 17:10 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org May 4, 2023 17:14 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org-stories May 4, 2023 17:14 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org-stories May 4, 2023 17:45 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org May 4, 2023 17:45 Inactive
@ovflowd
Copy link
Member

ovflowd commented May 4, 2023

@Harkunwar fyi that your branch is also desynced, and has 69 commits showing here. You probably need to recreate your branch and cherry pick your commits.

@Harkunwar
Copy link
Contributor Author

@ovflowd That should be fine since if you look at the files changed, it's correct. I did merge instead of rebase, which is why those commits show up. Once we squash merge this branch, there will be only a single commit on the major/website-redesign branch.

@ovflowd
Copy link
Member

ovflowd commented May 5, 2023

I mean sure, since we're squashing the commits the outcome will be the same, but just wanted to let you know that your PR history is polluted.

@ovflowd ovflowd merged commit 68a61ee into nodejs:major/website-redesign May 5, 2023
ovflowd added a commit that referenced this pull request May 17, 2023
* test(snapshot): Migrate snapshot tests to storybook (#5340)

Co-authored-by: Manish Kumar ⛄ <[email protected]>
Co-authored-by: Wai.Tung <[email protected]>
Co-authored-by: Shanmughapriyan S <[email protected]>
Co-authored-by: Michael Esteban <[email protected]>
Co-authored-by: Claudio Wunder <[email protected]>
Co-authored-by: Teja Sai Sandeep Reddy Konala <[email protected]>
Co-authored-by: Claudio Wunder <[email protected]>
Co-authored-by: vasanth9 <cheepurupalli.vasanthkumar.com>
Co-authored-by: Aymen Naghmouchi <[email protected]>
Co-authored-by: Teja Sai Sandeep Reddy Konala <[email protected]>
Co-authored-by: Augustin Mauroy <[email protected]>
Co-authored-by: Guilherme Araújo <[email protected]>
Co-authored-by: Augustin Mauroy <[email protected]>
Co-authored-by: HinataKah0 <[email protected]>
Co-authored-by: Olaleye Blessing <[email protected]>
Co-authored-by: ktssr <[email protected]>
Co-authored-by: vasanthkumar <[email protected]>
Co-authored-by: Floran Hachez <[email protected]>
Co-authored-by: Jatin <[email protected]>
fixed styleling misconfig and fixed storybooks (#5281)
fix storybook styles, imports, typescript config and dependencies (#5319
fix(package.json) Lint command is missing slashes (#5321
fix storybook local development mode (#5335)
fix(i18n): translation key (#5347)

* chore: no-unused-vars ignores pattern starting with _ (#5363)

* Contributing Guidelines Update - Add clarity to step 4 based on clone method (#5369)

Add clarity to step 4 based on clone method

Signed-off-by: Vessy Shestorkina <[email protected]>

* fix(test): dir name (#5354)

* feat(stability): migrate component (#5339)

* Migrate JsonLink component (#5370)

* Migrate JsonLink component

Signed-off-by: Vessy Shestorkina <[email protected]>

* Add storybook snap and robot icon

Signed-off-by: Vessy Shestorkina <[email protected]>

* Remove IconContext provider

Signed-off-by: Vessy Shestorkina <[email protected]>

---------

Signed-off-by: Vessy Shestorkina <[email protected]>
Signed-off-by: Claudio Wunder <[email protected]>
Co-authored-by: Claudio Wunder <[email protected]>

* refactor(useDownloadLink): Move useDetectOs to useDownloadLink (#5376)

* refactor(useDownloadLink): Move useDetectOs to useDownloadLink

* refactor(useDownloadLink): rename file

* refactor(useDownloadLink): rename file

* Apply suggestions from code review

Signed-off-by: Claudio Wunder <[email protected]>

* refactor(useDownloadLink): undo deleted file

---------

Signed-off-by: Claudio Wunder <[email protected]>
Co-authored-by: Claudio Wunder <[email protected]>

* feat: Add MUI Config and Theme Provider (#5368)

* feat: Add MUI Config and Theme Provider

* added createTheme

* refactor themeConfig

* feat(theme): Fix linting and package-lock

* feat(theme): Add emotion styled and emtion react

---------

Co-authored-by: Harkunwar Kochar <[email protected]>

* refactor(delete): duplicate test file (#5377)

refactor(test): Delete duplicate test file

Co-authored-by: Claudio Wunder <[email protected]>

* feat(useClickOutside): introduce (#5359)

* feat(useClickOutside): introduce

* Update hooks/useClickOutside.ts

Co-authored-by: Claudio Wunder <[email protected]>
Signed-off-by: Augustin Mauroy <[email protected]>

* feat(useClickOutside): fix and twix

* feat(dropdown): remove useless ref

* feat(useClickOutside): update unit test

* feat(UseClickOutside): update type

* fix: usage of type

* Update hooks/useClickOutside.ts

Co-authored-by: Claudio Wunder <[email protected]>
Signed-off-by: Augustin Mauroy <[email protected]>

* update listener

* Update components/Common/LanguageSelector/index.tsx

Co-authored-by: Shanmughapriyan S <[email protected]>
Signed-off-by: Augustin Mauroy <[email protected]>

* fix: languageSelector

* update with feedback

* better unit test

* Update hooks/useClickOutside.ts

Co-authored-by: Harkunwar Kochar <[email protected]>
Signed-off-by: Augustin Mauroy <[email protected]>

* feat(useClickOutside): update with feedback

* Update hooks/useClickOutside.ts

Co-authored-by: Shanmughapriyan S <[email protected]>
Signed-off-by: Augustin Mauroy <[email protected]>

* Update hooks/useClickOutside.ts

Co-authored-by: Shanmughapriyan S <[email protected]>
Signed-off-by: Augustin Mauroy <[email protected]>

* fix: if click on modal

* Update hooks/useClickOutside.ts

Co-authored-by: Harkunwar Kochar <[email protected]>
Signed-off-by: Augustin Mauroy <[email protected]>

* Update hooks/useClickOutside.ts

Signed-off-by: Harkunwar Kochar <[email protected]>

* Update hooks/useClickOutside.ts

Co-authored-by: Harkunwar Kochar <[email protected]>
Signed-off-by: Augustin Mauroy <[email protected]>

* Update useClickOutside.ts

* Update hooks/useClickOutside.ts

Co-authored-by: Shanmughapriyan S <[email protected]>
Signed-off-by: Augustin Mauroy <[email protected]>

* Update useClickOutside.ts

* Apply suggestions from code review

Signed-off-by: Claudio Wunder <[email protected]>

* Update hooks/useClickOutside.ts

Co-authored-by: Claudio Wunder <[email protected]>
Signed-off-by: Augustin Mauroy <[email protected]>

* Update hooks/useClickOutside.ts

Co-authored-by: Claudio Wunder <[email protected]>
Signed-off-by: Augustin Mauroy <[email protected]>

* fix: build

---------

Signed-off-by: Augustin Mauroy <[email protected]>
Signed-off-by: Harkunwar Kochar <[email protected]>
Signed-off-by: Claudio Wunder <[email protected]>
Co-authored-by: Claudio Wunder <[email protected]>
Co-authored-by: Shanmughapriyan S <[email protected]>
Co-authored-by: Harkunwar Kochar <[email protected]>

---------

Signed-off-by: Vessy Shestorkina <[email protected]>
Signed-off-by: Claudio Wunder <[email protected]>
Signed-off-by: Augustin Mauroy <[email protected]>
Signed-off-by: Harkunwar Kochar <[email protected]>
Co-authored-by: Harkunwar Kochar <[email protected]>
Co-authored-by: Manish Kumar ⛄ <[email protected]>
Co-authored-by: Wai.Tung <[email protected]>
Co-authored-by: Shanmughapriyan S <[email protected]>
Co-authored-by: Michael Esteban <[email protected]>
Co-authored-by: Teja Sai Sandeep Reddy Konala <[email protected]>
Co-authored-by: Aymen Naghmouchi <[email protected]>
Co-authored-by: Teja Sai Sandeep Reddy Konala <[email protected]>
Co-authored-by: Augustin Mauroy <[email protected]>
Co-authored-by: Guilherme Araújo <[email protected]>
Co-authored-by: Augustin Mauroy <[email protected]>
Co-authored-by: HinataKah0 <[email protected]>
Co-authored-by: Olaleye Blessing <[email protected]>
Co-authored-by: ktssr <[email protected]>
Co-authored-by: vasanthkumar <[email protected]>
Co-authored-by: Floran Hachez <[email protected]>
Co-authored-by: Jatin <[email protected]>
Co-authored-by: Vessy <[email protected]>
Co-authored-by: Mert Can Altın <[email protected]>
ovflowd added a commit that referenced this pull request May 24, 2023
Co-authored-by: Manish Kumar ⛄ <[email protected]>
Co-authored-by: Wai.Tung <[email protected]>
Co-authored-by: Shanmughapriyan S <[email protected]>
Co-authored-by: Michael Esteban <[email protected]>
Co-authored-by: Claudio Wunder <[email protected]>
Co-authored-by: Teja Sai Sandeep Reddy Konala <[email protected]>
Co-authored-by: Claudio Wunder <[email protected]>
Co-authored-by: vasanth9 <cheepurupalli.vasanthkumar.com>
Co-authored-by: Aymen Naghmouchi <[email protected]>
Co-authored-by: Teja Sai Sandeep Reddy Konala <[email protected]>
Co-authored-by: Augustin Mauroy <[email protected]>
Co-authored-by: Guilherme Araújo <[email protected]>
Co-authored-by: Augustin Mauroy <[email protected]>
Co-authored-by: HinataKah0 <[email protected]>
Co-authored-by: Olaleye Blessing <[email protected]>
Co-authored-by: ktssr <[email protected]>
Co-authored-by: vasanthkumar <[email protected]>
Co-authored-by: Floran Hachez <[email protected]>
Co-authored-by: Jatin <[email protected]>
fixed styleling misconfig and fixed storybooks (#5281)
fix storybook styles, imports, typescript config and dependencies (#5319
fix(package.json) Lint command is missing slashes (#5321
fix storybook local development mode (#5335)
fix(i18n): translation key (#5347)
ovflowd added a commit that referenced this pull request May 24, 2023
Co-authored-by: Manish Kumar ⛄ <[email protected]>
Co-authored-by: Wai.Tung <[email protected]>
Co-authored-by: Shanmughapriyan S <[email protected]>
Co-authored-by: Michael Esteban <[email protected]>
Co-authored-by: Claudio Wunder <[email protected]>
Co-authored-by: Teja Sai Sandeep Reddy Konala <[email protected]>
Co-authored-by: Claudio Wunder <[email protected]>
Co-authored-by: vasanth9 <cheepurupalli.vasanthkumar.com>
Co-authored-by: Aymen Naghmouchi <[email protected]>
Co-authored-by: Teja Sai Sandeep Reddy Konala <[email protected]>
Co-authored-by: Augustin Mauroy <[email protected]>
Co-authored-by: Guilherme Araújo <[email protected]>
Co-authored-by: Augustin Mauroy <[email protected]>
Co-authored-by: HinataKah0 <[email protected]>
Co-authored-by: Olaleye Blessing <[email protected]>
Co-authored-by: ktssr <[email protected]>
Co-authored-by: vasanthkumar <[email protected]>
Co-authored-by: Floran Hachez <[email protected]>
Co-authored-by: Jatin <[email protected]>
fixed styleling misconfig and fixed storybooks (#5281)
fix storybook styles, imports, typescript config and dependencies (#5319
fix(package.json) Lint command is missing slashes (#5321
fix storybook local development mode (#5335)
fix(i18n): translation key (#5347)
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.