Uh oh!
There was an error while loading. Please reload this page.
feat(blog) Migrate BlogCard component - #5323
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
mikeesto
commented
Apr 22, 2023
Thanks, see if you can fix the lint issue in |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ovflowd
commented
Apr 23, 2023
From the Stories, it looks like that:
Example how it should look like: |
Harkunwar
commented
Apr 23, 2023
I've made the requested changes |
ovflowd
left a comment
There was a problem hiding this comment.
We're almost there. But impressive work!!
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Harkunwar
commented
Apr 23, 2023
@ovflowd I feel like there's a lot of duplication in the way we're writing unit tests and stories. If we could directly import stories in our unit tests, we'll have less duplication. Storybook already allows it, so would it be worth doing that? |
If I add this to our import{setProjectAnnotations}from'@storybook/react';import*asglobalStorybookConfigfrom'./.storybook/preview';setProjectAnnotations(globalStorybookConfig);Object.defineProperty(window,'matchMedia',{writable: true,value: jest.fn().mockImplementation((query)=>({matches: false,media: query,onchange: null,addListener: jest.fn(),removeListener: jest.fn(),addEventListener: jest.fn(),removeEventListener: jest.fn(),dispatchEvent: jest.fn(),})),});Then we won't need to use import{render}from'@testing-library/react';import*asstoriesfrom'../index.stories';import{composeStories}from'@storybook/react';const{ Default }=composeStories(stories);jest.mock('next/router',()=>({useRouter: jest.fn().mockReturnValue({}),}));describe('BlogCard component',()=>{it('renders correctly',()=>{const{ container }=render(<Default/>);expect(container).toMatchSnapshot();});});And we can start using the stories in other tests as well instead of duplicating them multiple times. |
ovflowd
commented
Apr 24, 2023
@Harkunwar feel free to create an issue and work on a PR updating all tests to the approach you're suggesting :) |
…ponent Signed-off-by: Harkunwar Kochar <10580591+Harkunwar@users.noreply.github.com>
Co-authored-by: Michael Esteban <mickel13@gmail.com>
* feat(unit-test): introduce unit test on website redesign branch (#5178 feat(unit-test): introduce unit test * chore(minor): just a tiny design nitpick * chore: set up storybook (#5191) (#5214) * chore: set up testing-library jest extend (#5231) Co-authored-by: Manish Kumar ⛄ <manishprivet@protonmail.com> * chore(dependencies): updated dependencies * feat: create section title component (#5237) Co-authored-by: Wai.Tung <maledong_public@foxmail.com> * 📎 chore(migration): migrate banner component (#5233) Co-authored-by: Shanmughapriyan S <priyanshan03@gmail.com> Co-authored-by: Michael Esteban <mickel13@gmail.com> Co-authored-by: Claudio Wunder <cwunder@gnome.org> * feat: migrate AnimatedPlaceholder component (#5238 Migrate AnimatedPlaceholder component from nodejs.dev and create a new Story. * feat: create article alert component (#5243) * feat: migrate blockquote component (#5259) * feat(stylelint,storybook): fixed styleling misconfig and fixed storybooks (#5281) * feat: create article data tag component (#5280) * feat: migrate AuthorList component and add story 🎉 (#5277) Co-authored-by: Michael Esteban <mickel13@gmail.com> * chore(migration): migrate language selector component (#5266) Co-authored-by: Claudio Wunder <cwunder@gnome.org> Co-authored-by: Teja Sai Sandeep Reddy Konala <sandeep.konala@knacksystems.com> Co-authored-by: Shanmughapriyan S <priyanshan03@gmail.com> Co-authored-by: Michael Esteban <mickel13@gmail.com> * feat(DarkModeToggler): Migrate and add stories to theme toggler 🎉 (#5236) Co-authored-by: Claudio Wunder <cwunder@gnome.org> Co-authored-by: Claudio Wunder <cwunder@hubspot.com> * chore: updated contributing guidelines, eslint rules and storybook templates (#5294) Co-authored-by: Shanmughapriyan S <priyanshan03@gmail.com> Co-authored-by: Manish Kumar ⛄ <manishprivet@protonmail.com> * chore: contributing quick fix of example Signed-off-by: Claudio Wunder <cwunder@gnome.org> * chore: story guide and react spreading Signed-off-by: Claudio Wunder <cwunder@gnome.org> * chore: remove base styles from old styling * chore: fix storybook styles, imports, typescript config and dependencies (#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: adopt turborepo (#5316 * 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 command is missing slashes (#5321 fix(package.json) lint:fix missing slashes * moved `DataTag` to `components/Api` (#5317) Co-authored-by: vasanth9 <cheepurupalli.vasanthkumar.com> Co-authored-by: Shanmughapriyan S <priyanshan03@gmail.com> * hot-fix: dependency updates and fix dev runtime * chore: updated start command * migration(Layout): newFooter (#5320) Co-authored-by: Claudio Wunder <cwunder@gnome.org> * feat: migrate EditLink component (#5271) Co-authored-by: Claudio Wunder <cwunder@gnome.org> Co-authored-by: Wai.Tung <maledong_public@foxmail.com> * feat(blog) Migrate BlogCard component (#5323) Co-authored-by: Michael Esteban <mickel13@gmail.com> * Issue#5307 - Add framer-motion to the dependency list (#5318) * chore: add remote turbo cache and simplified gh actions cache (#5326)Co-authored-by: Aymen Naghmouchi <aymenadvance@gmail.com> * chore: add remote turbo cache and simplified gh actions cache * chore: updated cache rules * chore: more cache rules --------- Co-authored-by: Aymen Naghmouchi <aymenadvance@gmail.com> * chore: fix storybook local development mode (#5335) * chore: migrate pagination component (#5331) Co-authored-by: Teja Sai Sandeep Reddy Konala <tejasaisandeepreddykonala@MacBook-Pro.local> Co-authored-by: Claudio Wunder <cwunder@gnome.org> Co-authored-by: Wai.Tung <maledong_public@foxmail.com> * Chore(node feat) (#5338) Co-authored-by: Claudio Wunder <cwunder@gnome.org> * chore: migrate releases types (#5324) * hotfix: first element no margin-top * (website redesign) Feat(shellbox): migration (#5234) Co-authored-by: Manish Kumar ⛄ <manishprivet@protonmail.com> Co-authored-by: Claudio Wunder <cwunder@gnome.org> Co-authored-by: Shanmughapriyan S <priyanshan03@gmail.com> Co-authored-by: Michael Esteban <mickel13@gmail.com> Co-authored-by: Wai.Tung <maledong_public@foxmail.com> * fix(i18n): translation key (#5347) Co-authored-by: Shanmughapriyan S <priyanshan03@gmail.com> Co-authored-by: Claudio Wunder <cwunder@gnome.org> * chore: updated dependencies * chore: vercel enable middleware and i18n redirection (#5300) * feat(unit-test): introduce unit test on website redesign branch (#5178 feat(unit-test): introduce unit test * chore: set up storybook (#5191) (#5214) * feat(stylelint,storybook): fixed styleling misconfig and fixed storybooks (#5281) * feat(DarkModeToggler): Migrate and add stories to theme toggler 🎉 (#5236) Co-authored-by: Claudio Wunder <cwunder@gnome.org> Co-authored-by: Claudio Wunder <cwunder@hubspot.com> * chore: updated contributing guidelines, eslint rules and storybook templates (#5294) Co-authored-by: Shanmughapriyan S <priyanshan03@gmail.com> Co-authored-by: Manish Kumar ⛄ <manishprivet@protonmail.com> * chore: fix storybook styles, imports, typescript config and dependencies (#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: adopt turborepo (#5316 * 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 * feat(stability): migrate component * chore(snapshot): update * Update components/Api/Stability/index.tsx Co-authored-by: Claudio Wunder <cwunder@gnome.org> Signed-off-by: Augustin Mauroy <augustin.mauroy@outlook.fr> * Update components/Api/Stability/index.tsx Co-authored-by: Claudio Wunder <cwunder@gnome.org> Signed-off-by: Augustin Mauroy <augustin.mauroy@outlook.fr> * Update components/Api/Stability/index.tsx Co-authored-by: Claudio Wunder <cwunder@gnome.org> Signed-off-by: Augustin Mauroy <augustin.mauroy@outlook.fr> * fea(stability): update stories + fix * Update components/Api/Stability/index.stories.tsx Co-authored-by: Claudio Wunder <cwunder@gnome.org> Signed-off-by: Augustin Mauroy <augustin.mauroy@outlook.fr> * fix(i18n): update turkish language direction (#5182) * chore: rollback CODEOWNER changes (#5183) * Sync: merge `major/website-redesign` into `main` (#5356) Co-authored-by: Manish Kumar ⛄ <manishprivet@protonmail.com> Co-authored-by: Wai.Tung <maledong_public@foxmail.com> Co-authored-by: Shanmughapriyan S <priyanshan03@gmail.com> Co-authored-by: Michael Esteban <mickel13@gmail.com> Co-authored-by: Claudio Wunder <cwunder@gnome.org> Co-authored-by: Teja Sai Sandeep Reddy Konala <sandeep.konala@knacksystems.com> Co-authored-by: Claudio Wunder <cwunder@hubspot.com> Co-authored-by: vasanth9 <cheepurupalli.vasanthkumar.com> Co-authored-by: Aymen Naghmouchi <aymenadvance@gmail.com> Co-authored-by: Teja Sai Sandeep Reddy Konala <tejasaisandeepreddykonala@MacBook-Pro.local> Co-authored-by: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com> Co-authored-by: Guilherme Araújo <guilherme.araujo@maxxidata.com> Co-authored-by: Augustin Mauroy <augustin.mauroy@outlook.fr> Co-authored-by: HinataKah0 <128208841+HinataKah0@users.noreply.github.com> Co-authored-by: Olaleye Blessing <Olayinkablexxy@gmail.com> Co-authored-by: ktssr <31731919+ktssr@users.noreply.github.com> Co-authored-by: Harkunwar Kochar <10580591+Harkunwar@users.noreply.github.com> Co-authored-by: vasanthkumar <42891954+vasanth9@users.noreply.github.com> Co-authored-by: Floran Hachez <floran.hachez@gmail.com> Co-authored-by: Jatin <96469998+JatinSharma32@users.noreply.github.com> * feat(stability): update snapshot * Update components/Api/Stability/index.tsx Co-authored-by: Jithil P Ponnan <MrJithil@users.noreply.github.com> Signed-off-by: Augustin Mauroy <augustin.mauroy@outlook.fr> * code format * Update components/Api/Stability/index.tsx Co-authored-by: Jithil P Ponnan <MrJithil@users.noreply.github.com> Signed-off-by: Augustin Mauroy <augustin.mauroy@outlook.fr> --------- Signed-off-by: Claudio Wunder <cwunder@gnome.org> Signed-off-by: Augustin Mauroy <augustin.mauroy@outlook.fr> Co-authored-by: Claudio Wunder <cwunder@hubspot.com> Co-authored-by: Guilherme Araújo <guilherme.araujo@maxxidata.com> Co-authored-by: Manish Kumar ⛄ <manishprivet@protonmail.com> Co-authored-by: Claudio Wunder <cwunder@gnome.org> Co-authored-by: Wai.Tung <maledong_public@foxmail.com> Co-authored-by: Shanmughapriyan S <priyanshan03@gmail.com> Co-authored-by: Michael Esteban <mickel13@gmail.com> Co-authored-by: HinataKah0 <128208841+HinataKah0@users.noreply.github.com> Co-authored-by: Olaleye Blessing <Olayinkablexxy@gmail.com> Co-authored-by: ktssr <31731919+ktssr@users.noreply.github.com> Co-authored-by: Teja Sai Sandeep Reddy Konala <sandeep.konala@knacksystems.com> Co-authored-by: Harkunwar Kochar <10580591+Harkunwar@users.noreply.github.com> Co-authored-by: vasanthkumar <42891954+vasanth9@users.noreply.github.com> Co-authored-by: Jatin <96469998+JatinSharma32@users.noreply.github.com> Co-authored-by: Aymen Naghmouchi <aymenadvance@gmail.com> Co-authored-by: Teja Sai Sandeep Reddy Konala <tejasaisandeepreddykonala@MacBook-Pro.local> Co-authored-by: Yagiz Nizipli <yagiz@nizipli.com> Co-authored-by: Nick Schonning <nschonni@gmail.com> Co-authored-by: Floran Hachez <floran.hachez@gmail.com> Co-authored-by: Jithil P Ponnan <MrJithil@users.noreply.github.com>

This PR aims to migrate the BlogCard component as mentioned in #5308