From 5350eb2360a93c8e727822cc81f84ab4382dc6a8 Mon Sep 17 00:00:00 2001
From: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com>
Date: Thu, 9 Mar 2023 22:17:40 +0100
Subject: [PATCH] fix(ci)
---
.eslintignore | 1 +
.../__snapshots__/index.test.tsx.snap | 2 +-
.../__snapshots__/index.test.tsx.snap | 20 ++++++++--------
.../__snapshots__/index.test.tsx.snap | 24 +++++++++----------
.../__snapshots__/learn.test.tsx.snap | 8 +++----
util-node/__tests__/getBannersData.test.ts | 7 +++---
util-node/getBannersData.js | 2 --
7 files changed, 31 insertions(+), 33 deletions(-)
diff --git a/.eslintignore b/.eslintignore
index 38625b1002..9d06233755 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -2,3 +2,4 @@
public
docs/
meetings/
+build/
diff --git a/src/components/ApiComponents/Components/__tests__/__snapshots__/index.test.tsx.snap b/src/components/ApiComponents/Components/__tests__/__snapshots__/index.test.tsx.snap
index 7d68783720..cdbdfc6f50 100644
--- a/src/components/ApiComponents/Components/__tests__/__snapshots__/index.test.tsx.snap
+++ b/src/components/ApiComponents/Components/__tests__/__snapshots__/index.test.tsx.snap
@@ -54,7 +54,7 @@ exports[`ApiComponents Components renders JsonLink component correctly 1`] = `
xmlns="http://www.w3.org/2000/svg"
>
diff --git a/src/components/ArticleComponents/Pagination/__tests__/__snapshots__/index.test.tsx.snap b/src/components/ArticleComponents/Pagination/__tests__/__snapshots__/index.test.tsx.snap
index dac2fcd52d..e1192b8da1 100644
--- a/src/components/ArticleComponents/Pagination/__tests__/__snapshots__/index.test.tsx.snap
+++ b/src/components/ArticleComponents/Pagination/__tests__/__snapshots__/index.test.tsx.snap
@@ -18,11 +18,11 @@ exports[`Pagination component only renders links to pages that has a title 1`] =
focusable="false"
role="img"
style="margin-right: 5px;"
- viewBox="0 0 512 512"
+ viewBox="0 0 448 512"
xmlns="http://www.w3.org/2000/svg"
>
@@ -52,11 +52,11 @@ exports[`Pagination component renders correctly when there is no next page 1`] =
focusable="false"
role="img"
style="margin-right: 5px;"
- viewBox="0 0 512 512"
+ viewBox="0 0 448 512"
xmlns="http://www.w3.org/2000/svg"
>
@@ -88,11 +88,11 @@ exports[`Pagination component renders correctly when there is no previous page 1
focusable="false"
role="img"
style="margin-left: 5px;"
- viewBox="0 0 512 512"
+ viewBox="0 0 448 512"
xmlns="http://www.w3.org/2000/svg"
>
@@ -120,11 +120,11 @@ exports[`Pagination component renders links to the next and previous page 1`] =
focusable="false"
role="img"
style="margin-right: 5px;"
- viewBox="0 0 512 512"
+ viewBox="0 0 448 512"
xmlns="http://www.w3.org/2000/svg"
>
@@ -145,11 +145,11 @@ exports[`Pagination component renders links to the next and previous page 1`] =
focusable="false"
role="img"
style="margin-left: 5px;"
- viewBox="0 0 512 512"
+ viewBox="0 0 448 512"
xmlns="http://www.w3.org/2000/svg"
>
diff --git a/src/sections/Article/__tests__/__snapshots__/index.test.tsx.snap b/src/sections/Article/__tests__/__snapshots__/index.test.tsx.snap
index 58be604a74..dc23e96e5d 100644
--- a/src/sections/Article/__tests__/__snapshots__/index.test.tsx.snap
+++ b/src/sections/Article/__tests__/__snapshots__/index.test.tsx.snap
@@ -156,11 +156,11 @@ exports[`Article component renders correctly 1`] = `
focusable="false"
role="img"
style="margin-right: 5px;"
- viewBox="0 0 512 512"
+ viewBox="0 0 448 512"
xmlns="http://www.w3.org/2000/svg"
>
@@ -181,11 +181,11 @@ exports[`Article component renders correctly 1`] = `
focusable="false"
role="img"
style="margin-left: 5px;"
- viewBox="0 0 512 512"
+ viewBox="0 0 448 512"
xmlns="http://www.w3.org/2000/svg"
>
@@ -451,11 +451,11 @@ exports[`Article component renders correctly in case body ref is null 1`] = `
focusable="false"
role="img"
style="margin-right: 5px;"
- viewBox="0 0 512 512"
+ viewBox="0 0 448 512"
xmlns="http://www.w3.org/2000/svg"
>
@@ -476,11 +476,11 @@ exports[`Article component renders correctly in case body ref is null 1`] = `
focusable="false"
role="img"
style="margin-left: 5px;"
- viewBox="0 0 512 512"
+ viewBox="0 0 448 512"
xmlns="http://www.w3.org/2000/svg"
>
@@ -652,11 +652,11 @@ exports[`Article component should accept and render child components 1`] = `
focusable="false"
role="img"
style="margin-right: 5px;"
- viewBox="0 0 512 512"
+ viewBox="0 0 448 512"
xmlns="http://www.w3.org/2000/svg"
>
@@ -677,11 +677,11 @@ exports[`Article component should accept and render child components 1`] = `
focusable="false"
role="img"
style="margin-left: 5px;"
- viewBox="0 0 512 512"
+ viewBox="0 0 448 512"
xmlns="http://www.w3.org/2000/svg"
>
diff --git a/src/templates/__tests__/__snapshots__/learn.test.tsx.snap b/src/templates/__tests__/__snapshots__/learn.test.tsx.snap
index 038b58bf68..cc465a49bc 100644
--- a/src/templates/__tests__/__snapshots__/learn.test.tsx.snap
+++ b/src/templates/__tests__/__snapshots__/learn.test.tsx.snap
@@ -518,11 +518,11 @@ exports[`Learn Template renders correctly 1`] = `
focusable="false"
role="img"
style="margin-right: 5px;"
- viewBox="0 0 512 512"
+ viewBox="0 0 448 512"
xmlns="http://www.w3.org/2000/svg"
>
@@ -543,11 +543,11 @@ exports[`Learn Template renders correctly 1`] = `
focusable="false"
role="img"
style="margin-left: 5px;"
- viewBox="0 0 512 512"
+ viewBox="0 0 448 512"
xmlns="http://www.w3.org/2000/svg"
>
diff --git a/util-node/__tests__/getBannersData.test.ts b/util-node/__tests__/getBannersData.test.ts
index 0101e19192..f6a61dad08 100644
--- a/util-node/__tests__/getBannersData.test.ts
+++ b/util-node/__tests__/getBannersData.test.ts
@@ -12,12 +12,11 @@ describe('getBannersData', () => {
it('should retrieve banners from correct URL', async () => {
// import dynamically in order to apply mock for node-fetch
const getBannersData = (await import('../getBannersData')).default;
- fetchMock.mockResponseOnce(JSON.stringify({ banners: ['mocked-banner'] }));
- const banners = await getBannersData();
+ fetchMock.mockResponseOnce(JSON.stringify({}));
+ await getBannersData();
- expect(banners).toStrictEqual(['mocked-banner']);
expect(fetchMock.mock.calls[0][0]).toBe(
- 'https://raw.githubusercontent.com/nodejs/nodejs.org/main/locale/en/site.json'
+ 'https://raw.githubusercontent.com/nodejs/nodejs.org/main/site.json'
);
});
diff --git a/util-node/getBannersData.js b/util-node/getBannersData.js
index 8fd9869498..5b1da104fe 100644
--- a/util-node/getBannersData.js
+++ b/util-node/getBannersData.js
@@ -1,7 +1,5 @@
const { nodeBannersData } = require('../apiUrls');
-// @TODO: In the future the Banners Data should be stored directly in this Repository
-// If this repository ever replaces the Nodejs.org repository
function getBannersData() {
// This function gets the current Nodejs.org website metadata
// And retrieves the `banners` data to display on the website