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

fix(test): dir name #5354

Merged
merged 109 commits into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from 106 commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
bd8a46e
feat(unit-test): introduce unit test on website redesign branch (#5178
AugustinMauroy Mar 23, 2023
80039d3
chore(redesign): added new folders for new layouts and new pages
ovflowd Mar 27, 2023
cdbc4b4
chore(minor): just a tiny design nitpick
ovflowd Mar 27, 2023
df79868
chore: set up storybook (#5191) (#5214)
Apr 1, 2023
ecbec61
feat(ignore): add storyBook (#5229)
AugustinMauroy Apr 5, 2023
a2a4bd8
chore: set up testing-library jest extend (#5231)
Apr 6, 2023
67999b6
chore(dependencies): updated dependencies
ovflowd Apr 7, 2023
48d6c91
feat: create section title component (#5237)
Apr 8, 2023
6ce6923
📎 chore(migration): migrate banner component (#5233)
manishprivet Apr 11, 2023
f9d9765
feat: migrate AnimatedPlaceholder component (#5238
HinataKah0 Apr 11, 2023
9311785
feat: create article alert component (#5243)
Apr 11, 2023
06ce22b
chore(dependencies): updated dependencies
ovflowd Apr 12, 2023
386a458
fix: formatted file
ovflowd Apr 15, 2023
0240b9b
chore: updated deps
ovflowd Apr 15, 2023
ffa9a3e
feat: migrate blockquote component (#5259)
Apr 15, 2023
390c2da
feat(stylelint,storybook): fixed styleling misconfig and fixed storyb…
ovflowd Apr 18, 2023
e121b83
feat: create article data tag component (#5280)
Olaleye-Blessing Apr 18, 2023
d7a154d
feat: migrate AuthorList component and add story 🎉 (#5277)
shanpriyan Apr 19, 2023
620f58e
chore: lock nextjs to 13.2.0 (#5301
ovflowd Apr 19, 2023
79b5134
chore(migration): migrate language selector component (#5266)
ktssr Apr 20, 2023
bb46dfe
feat(DarkModeToggler): Migrate and add stories to theme toggler 🎉 (#5…
shanpriyan Apr 20, 2023
bfcabb9
chore: updated contributing guidelines, eslint rules and storybook te…
ovflowd Apr 20, 2023
f6dc39f
chore: contributing quick fix of example
ovflowd Apr 20, 2023
2eba819
chore: story guide and react spreading
ovflowd Apr 20, 2023
86b60f3
chore: remove base styles from old styling
ovflowd Apr 20, 2023
1f4530e
chore: fix storybook styles, imports, typescript config and dependenc…
ovflowd Apr 21, 2023
b8c76cd
chore: adopt turborepo (#5316
ovflowd Apr 21, 2023
5891807
fix(package.json) Lint command is missing slashes (#5321
Harkunwar Apr 21, 2023
ca8b5ab
moved `DataTag` to `components/Api` (#5317)
vasanth9 Apr 21, 2023
c2aeeaa
hot-fix: dependency updates and fix dev runtime
ovflowd Apr 24, 2023
86057dc
chore: updated start command
ovflowd Apr 24, 2023
17b698f
migration(Layout): newFooter (#5320)
AugustinMauroy Apr 24, 2023
f989ea9
feat: migrate EditLink component (#5271)
HinataKah0 Apr 24, 2023
f49c166
Migrate detect os hook (#5322)
FHachez Apr 24, 2023
154890b
feat(blog) Migrate BlogCard component (#5323)
Harkunwar Apr 25, 2023
bd24994
Issue#5307 - Add framer-motion to the dependency list (#5318)
JatinSharma32 Apr 24, 2023
763aebe
chore: add remote turbo cache and simplified gh actions cache (#5326)…
ovflowd Apr 26, 2023
f5fed8d
chore: fix storybook local development mode (#5335)
Apr 27, 2023
d27d83a
chore: migrate pagination component (#5331)
ktssr Apr 28, 2023
d421b0b
Chore(node feat) (#5338)
AugustinMauroy Apr 30, 2023
e175feb
chore: migrate releases types (#5324)
HinataKah0 May 1, 2023
aa1c542
hotfix: first element no margin-top
ovflowd May 2, 2023
d5fbf51
(website redesign) Feat(shellbox): migration (#5234)
AugustinMauroy May 3, 2023
7ddfa8d
fix(i18n): translation key (#5347)
AugustinMauroy May 3, 2023
da41023
fix(test): dir name
AugustinMauroy May 3, 2023
c24e8af
feat(test): update config
AugustinMauroy May 3, 2023
368c054
feat(unit-test): introduce unit test on website redesign branch (#5178
AugustinMauroy Mar 23, 2023
69544fb
chore(redesign): added new folders for new layouts and new pages
ovflowd Mar 27, 2023
cbe14c3
chore(minor): just a tiny design nitpick
ovflowd Mar 27, 2023
7b57ee4
chore: set up storybook (#5191) (#5214)
Apr 1, 2023
8d4b07f
feat(ignore): add storyBook (#5229)
AugustinMauroy Apr 5, 2023
c2fe0cd
chore: set up testing-library jest extend (#5231)
Apr 6, 2023
7227b35
chore(dependencies): updated dependencies
ovflowd Apr 7, 2023
eaff4f4
feat: create section title component (#5237)
Apr 8, 2023
a994f19
📎 chore(migration): migrate banner component (#5233)
manishprivet Apr 11, 2023
a83ff81
feat: migrate AnimatedPlaceholder component (#5238
HinataKah0 Apr 11, 2023
60b2dc6
feat: create article alert component (#5243)
Apr 11, 2023
4013c4d
fix: formatted file
ovflowd Apr 15, 2023
3c2b02a
feat: migrate blockquote component (#5259)
Apr 15, 2023
d8ebddc
feat(stylelint,storybook): fixed styleling misconfig and fixed storyb…
ovflowd Apr 18, 2023
36d12ad
feat: create article data tag component (#5280)
Olaleye-Blessing Apr 18, 2023
1232e16
feat: migrate AuthorList component and add story 🎉 (#5277)
shanpriyan Apr 19, 2023
b72d29f
chore: lock nextjs to 13.2.0 (#5301
ovflowd Apr 19, 2023
bf82db5
chore(migration): migrate language selector component (#5266)
ktssr Apr 20, 2023
66fe550
feat(DarkModeToggler): Migrate and add stories to theme toggler 🎉 (#5…
shanpriyan Apr 20, 2023
6407340
chore: updated contributing guidelines, eslint rules and storybook te…
ovflowd Apr 20, 2023
562136c
chore: contributing quick fix of example
ovflowd Apr 20, 2023
63e1cad
chore: story guide and react spreading
ovflowd Apr 20, 2023
4ce0f6a
chore: remove base styles from old styling
ovflowd Apr 20, 2023
3012a68
chore: fix storybook styles, imports, typescript config and dependenc…
ovflowd Apr 21, 2023
71134b5
chore: adopt turborepo (#5316
ovflowd Apr 21, 2023
443392b
fix(package.json) Lint command is missing slashes (#5321
Harkunwar Apr 21, 2023
9b6768b
moved `DataTag` to `components/Api` (#5317)
vasanth9 Apr 21, 2023
14cc994
hot-fix: dependency updates and fix dev runtime
ovflowd Apr 24, 2023
53adc57
chore: updated start command
ovflowd Apr 24, 2023
8a86fad
migration(Layout): newFooter (#5320)
AugustinMauroy Apr 24, 2023
e322d56
feat: migrate EditLink component (#5271)
HinataKah0 Apr 24, 2023
d910567
Migrate detect os hook (#5322)
FHachez Apr 24, 2023
b95b3b8
feat(blog) Migrate BlogCard component (#5323)
Harkunwar Apr 25, 2023
acb9794
Issue#5307 - Add framer-motion to the dependency list (#5318)
JatinSharma32 Apr 24, 2023
c6b75f3
chore: add remote turbo cache and simplified gh actions cache (#5326)…
ovflowd Apr 26, 2023
ce39f3e
chore: fix storybook local development mode (#5335)
Apr 27, 2023
d1049e9
chore: migrate pagination component (#5331)
ktssr Apr 28, 2023
0b1369c
Chore(node feat) (#5338)
AugustinMauroy Apr 30, 2023
d90722e
chore: migrate releases types (#5324)
HinataKah0 May 1, 2023
1745cc9
hotfix: first element no margin-top
ovflowd May 2, 2023
c400d05
(website redesign) Feat(shellbox): migration (#5234)
AugustinMauroy May 3, 2023
e4d3697
fix(i18n): translation key (#5347)
AugustinMauroy May 3, 2023
f2a3ac4
chore: updated dependencies
ovflowd May 3, 2023
c53b474
feat(unit-test): introduce unit test on website redesign branch (#5178
AugustinMauroy Mar 23, 2023
d85d18e
chore: set up storybook (#5191) (#5214)
Apr 1, 2023
051b1a3
feat(stylelint,storybook): fixed styleling misconfig and fixed storyb…
ovflowd Apr 18, 2023
7801e15
chore: lock nextjs to 13.2.0 (#5301
ovflowd Apr 19, 2023
7fb2102
feat(DarkModeToggler): Migrate and add stories to theme toggler 🎉 (#5…
shanpriyan Apr 20, 2023
6a82522
chore: updated contributing guidelines, eslint rules and storybook te…
ovflowd Apr 20, 2023
09dcfb6
chore: fix storybook styles, imports, typescript config and dependenc…
ovflowd Apr 21, 2023
5b57ae8
chore: adopt turborepo (#5316
ovflowd Apr 21, 2023
b38df13
fix(test): dir name
AugustinMauroy May 3, 2023
7591522
code format
AugustinMauroy May 4, 2023
5d1910e
Merge branch 'fix-test' of https://github.com/AugustinMauroy/nodejs.o…
AugustinMauroy May 4, 2023
fabc802
fix
AugustinMauroy May 4, 2023
68d92e1
chore: vercel enable middleware and i18n redirection (#5300)
ovflowd May 4, 2023
fc04b6c
Merge branch 'major/website-redesign' into fix-test
AugustinMauroy May 4, 2023
d41adc5
Sync: merge `major/website-redesign` into `main` (#5356)
ovflowd May 4, 2023
63e585f
Merge branch 'major/website-redesign' into fix-test
AugustinMauroy May 4, 2023
7fe2ec1
Merge branch 'major/website-redesign' into fix-test
SEWeiTung May 6, 2023
55f02c9
update with feedback
AugustinMauroy May 7, 2023
2439f69
Merge branch 'major/website-redesign' into fix-test
AugustinMauroy May 11, 2023
d24f85b
Merge branch 'major/website-redesign' into fix-test
Harkunwar May 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`NodeFeatures should render 1`] = `
<div>
<section
class="nodeFeatures"
>
<div
class="container"
>
<svg
alt="Node Feature"
class="featureIcon"
fill="currentColor"
height="1em"
stroke="currentColor"
stroke-width="0"
viewBox="0 0 512 512"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M255.917 480a32.536 32.536 0 0 1-16.633-4.599l-52.985-32.44c-7.914-4.562-4.023-6.203-1.443-7.141 10.565-3.781 13.713-5.657 24.947-12.285 1.206-.667 2.747-.424 3.955.322l39.71 23.504c1.476.85 3.557.85 4.931 0l155.188-92.246c1.475-.877 2.415-2.646 2.415-4.441V163.869c0-1.85-.94-3.592-2.449-4.528l-155.12-94.672c-1.478-.894-3.421-.894-4.898 0L98.516 159.374c-1.544.903-2.516 2.698-2.516 4.495v186.805c0 1.813.972 3.513 2.481 4.389l39.929 23.972c23.61 12.204 37.59-.17 37.59-14.611V180.725c0-2.652 2.047-4.727 4.596-4.727h22.809c2.515 0 4.597 2.072 4.597 4.727v183.698c0 32.563-19.353 51.248-49.199 51.248-9.156 0-16.397 0-36.552-10.279l-41.584-24.781C70.371 374.459 64 362.965 64 350.656V161.191c0-12.316 6.371-23.784 16.665-29.917L239.35 36.41c10.027-5.88 23.374-5.88 33.332 0l158.65 94.864C441.63 137.423 448 148.899 448 161.191v189.465c0 12.309-6.37 23.75-16.668 29.953l-158.65 94.774a32.52 32.52 0 0 1-16.698 4.599l-.067.018z"
/>
<path
d="M304.943 351.998c-64.61 0-84.006-31.61-84.006-59.271 0-2.629 2.048-4.729 4.562-4.729h20.521c2.282 0 4.227 1.7 4.562 4.016 3.084 21.602 16.748 31.15 54.324 31.15 33.399 0 47.091-10.346 47.091-28.684 0-10.592-3.463-18.424-55.407-23.697-43.427-4.441-70.288-14.373-70.288-50.295 0-33.135 26.996-52.49 72.234-52.49 46.128 0 76.462 14 79.173 50.829.102 1.337-.368 2.629-1.241 3.644-.871.965-2.078 1.527-3.353 1.527h-20.591c-2.146 0-4.024-1.562-4.459-3.713-4.401-16.953-16.97-23.402-49.563-23.402-36.486 0-40.746 12.753-40.746 22.607 0 11.963 5.031 15.441 54.294 22.172 48.761 6.663 71.933 16.117 71.933 51.552 0 35.781-28.808 58.783-79.075 58.783l.035.001z"
/>
</svg>
<h2
class="t-subheading2"
>
components.home.nodeFeatures.javascript.title
</h2>
<p>
components.home.nodeFeatures.javascript.description
</p>
</div>
<div
class="container"
>
<svg
alt="Node Feature"
class="featureIcon"
fill="currentColor"
height="1em"
stroke="currentColor"
stroke-width="0"
viewBox="0 0 512 512"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M416 376.6V206.8c0-46.4-3.7-70.8-22.1-94C374 87.7 348.9 77 310 77h-22V16l-96 96 96 96v-65h22c24.6 0 29 3.6 33.8 9.6 5.5 6.9 8.2 19.1 8.2 54.2v169.8c-19.1 11.1-32 31.7-32 55.4 0 35.3 28.7 64 64 64s64-28.7 64-64c0-23.7-12.9-44.3-32-55.4zM384 472c-22.1 0-40-17.9-40-40s17.9-40 40-40 40 17.9 40 40-17.9 40-40 40zM128 48c-35.3 0-64 28.7-64 64 0 23.7 12.9 44.3 32 55.4v209.2c-19.1 11.1-32 31.7-32 55.4 0 35.3 28.7 64 64 64s64-28.7 64-64c0-23.7-12.9-44.3-32-55.4V167.4c19.1-11.1 32-31.7 32-55.4 0-35.3-28.7-64-64-64zm0 424c-22.1 0-40-17.9-40-40s17.9-40 40-40 40 17.9 40 40-17.9 40-40 40zm0-320c-22.1 0-40-17.9-40-40s17.9-40 40-40 40 17.9 40 40-17.9 40-40 40z"
/>
</svg>
<h2
class="t-subheading2"
>
components.home.nodeFeatures.openSource.title
</h2>
<p>
components.home.nodeFeatures.openSource.description
</p>
</div>
<div
class="container"
>
<svg
alt="Node Feature"
class="featureIcon"
fill="currentColor"
height="1em"
stroke="currentColor"
stroke-width="0"
viewBox="0 0 512 512"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M256 421.6c-18.1 0-33.2-6.8-42.9-10.9-5.4-2.3-11.3 1.8-10.9 7.6l3.5 51c.2 3.1 3.8 4.7 6.3 2.8l14.5-11c1.8-1.4 4.5-.9 5.7 1l20.5 32.1c1.5 2.4 5.1 2.4 6.6 0l20.5-32.1c1.2-1.9 3.9-2.4 5.7-1l14.5 11c2.5 1.9 6.1.3 6.3-2.8l3.5-51c.4-5.8-5.5-10-10.9-7.6-9.8 4.1-24.8 10.9-42.9 10.9z"
/>
<path
d="M397.7 293.1l-48-49.1c0-158-93.2-228-93.2-228s-94.1 70-94.1 228l-48 49.1c-1.8 1.8-2.6 4.5-2.2 7.1L130.6 412c.9 5.7 7.1 8.5 11.8 5.4l67.1-45.4s20.7 20 47.1 20c26.4 0 46.1-20 46.1-20l67.1 45.4c4.6 3.1 10.8.3 11.8-5.4l18.5-111.9c.2-2.6-.6-5.2-2.4-7zM256.5 192c-17 0-30.7-14.3-30.7-32s13.8-32 30.7-32c17 0 30.7 14.3 30.7 32s-13.7 32-30.7 32z"
/>
</svg>
<h2
class="t-subheading2"
>
components.home.nodeFeatures.everywhere.title
</h2>
<p>
components.home.nodeFeatures.everywhere.description
</p>
</div>
</section>
</div>
`;
14 changes: 14 additions & 0 deletions components/Home/NodeFeatures/__tests__/index.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { render } from '@testing-library/react';
import { IntlProvider } from 'react-intl';
import NodeFeatures from '../index';

describe('NodeFeatures', () => {
it('should render', () => {
const { container } = render(
<IntlProvider locale="en" onError={() => {}}>
<NodeFeatures />
</IntlProvider>
);
expect(container).toMatchSnapshot();
});
});
59 changes: 59 additions & 0 deletions hooks/__tests__/useCopyToClipboard.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { render, fireEvent, screen } from '@testing-library/react';
import { FormattedMessage } from 'react-intl';
import { IntlProvider } from 'react-intl';
import { useCopyToClipboard } from '../useCopyToClipboard';

const mockWriteText = jest.fn();
const originalNavigator = { ...window.navigator };

describe('useCopyToClipboard', () => {
beforeEach(() => {
Object.defineProperty(window, 'navigator', {
value: {
clipboard: {
writeText: mockWriteText,
},
},
});
});

afterEach(() => {
Object.defineProperty(window, 'navigator', {
value: originalNavigator,
});
});

const TestComponent = ({ textToCopy }: { textToCopy: string }) => {
const [copied, copyText] = useCopyToClipboard();

return (
<IntlProvider locale="en" onError={() => {}}>
<button onClick={() => copyText(textToCopy)} type="button">
<FormattedMessage
id="components.common.shellBox.copy"
values={{ copied }}
/>
</button>
</IntlProvider>
);
};

it('should call clipboard API with `test` once', () => {
const navigatorClipboardWriteTextSpy = jest
.fn()
.mockImplementation(() => Promise.resolve());

Object.defineProperty(window.navigator, 'clipboard', {
writable: true,
value: {
writeText: navigatorClipboardWriteTextSpy,
},
});

render(<TestComponent textToCopy="test" />);
const button = screen.getByRole('button');
fireEvent.click(button);
expect(navigatorClipboardWriteTextSpy).toHaveBeenCalledTimes(1);
expect(navigatorClipboardWriteTextSpy).toHaveBeenCalledWith('test');
});
});
1 change: 1 addition & 0 deletions jest.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const customJestConfig = {
setupFilesAfterEnv: ['<rootDir>/jest.setup.mjs'],
moduleDirectories: ['node_modules', '<rootDir>/'],
testEnvironment: 'jest-environment-jsdom',
testMatch: ['**/__tests__/*.test.{,ts,tsx}'],
};

export default createJestConfig(customJestConfig);