Repository: nodejs/nodejs.dev
Pull request #2958 (2022-10-25 10:42:22)

fix(banners): fixed small banner alignment issue
<!--
Please read the [Code of Conduct](https://github.com/nodejs/nodejs.dev/blob/main/CODE_OF_CONDUCT.md) and the [Contributing Guidelines](https://github.com/nodejs/nodejs.dev/blob/main/CONTRIBUTING.md) before opening a pull request.
-->

## Description

This PR updates some CSS fixes on banners and updates some snapshots that were failing.



ovflowd: cc @nodejs/nodejs-dev I'm proceeding with merging this as `main` is failing.

Patch:
diff --git a/src/components/CommonComponents/Banner/index.module.scss b/src/components/CommonComponents/Banner/index.module.scss
index bd435293..2c35f47e 100644
--- a/src/components/CommonComponents/Banner/index.module.scss
+++ b/src/components/CommonComponents/Banner/index.module.scss
@@ -12,7 +12,14 @@
   }
 
   a {
-    display: block;
+    align-items: center;
+    display: flex;
+    flex-direction: column;
+    text-decoration: none;
+
+    &:hover {
+      text-decoration: underline;
+    }
 
     img {
       border-radius: 5px;


Test patch:
diff --git a/src/util/__tests__/__snapshots__/getUpcomingReleases.test.ts.snap b/src/util/__tests__/__snapshots__/getUpcomingReleases.test.ts.snap
new file mode 100644
index 00000000..f8fc2e7b
--- /dev/null
+++ b/src/util/__tests__/__snapshots__/getUpcomingReleases.test.ts.snap
@@ -0,0 +1,81 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`getUpcomingReleases should compute upcoming releases correctly 1`] = `
+[
+  {
+    "releases": [
+      {
+        "alreadyReleased": true,
+        "releaseDate": "2019-04-23",
+        "releaseType": "Current",
+      },
+      {
+        "alreadyReleased": true,
+        "releaseDate": "2019-10-21",
+        "releaseType": "LTS",
+      },
+      {
+        "alreadyReleased": true,
+        "releaseDate": "2020-11-30",
+        "releaseType": "Maintenance",
+      },
+      {
+        "alreadyReleased": true,
+        "releaseDate": "2022-04-30",
+        "releaseType": "End-of-life",
+      },
+    ],
+    "title": "v12",
+  },
+  {
+    "releases": [
+      {
+        "alreadyReleased": true,
+        "releaseDate": "2020-04-21",
+        "releaseType": "Current",
+      },
+      {
+        "alreadyReleased": true,
+        "releaseDate": "2020-10-17",
+        "releaseType": "LTS",
+      },
+      {
+        "alreadyReleased": true,
+        "releaseDate": "2021-10-19",
+        "releaseType": "Maintenance",
+      },
+      {
+        "alreadyReleased": false,
+        "releaseDate": "2023-04-30",
+        "releaseType": "End-of-life",
+      },
+    ],
+    "title": "v14",
+  },
+  {
+    "releases": [
+      {
+        "alreadyReleased": true,
+        "releaseDate": "2022-04-19",
+        "releaseType": "Current",
+      },
+      {
+        "alreadyReleased": true,
+        "releaseDate": "2022-10-25",
+        "releaseType": "LTS",
+      },
+      {
+        "alreadyReleased": false,
+        "releaseDate": "2023-10-18",
+        "releaseType": "Maintenance",
+      },
+      {
+        "alreadyReleased": false,
+        "releaseDate": "2025-04-30",
+        "releaseType": "End-of-life",
+      },
+    ],
+    "title": "v18",
+  },
+]
+`;
diff --git a/src/util/__tests__/getUpcomingReleases.test.ts b/src/util/__tests__/getUpcomingReleases.test.ts
index a8307603..517b13b7 100644
--- a/src/util/__tests__/getUpcomingReleases.test.ts
+++ b/src/util/__tests__/getUpcomingReleases.test.ts
@@ -42,82 +42,6 @@ describe('getUpcomingReleases', () => {
           isLts: false,
         },
       ])
-    ).toStrictEqual([
-      {
-        releases: [
-          {
-            alreadyReleased: true,
-            releaseDate: '2019-04-23',
-            releaseType: 'Current',
-          },
-          {
-            alreadyReleased: true,
-            releaseDate: '2019-10-21',
-            releaseType: 'LTS',
-          },
-          {
-            alreadyReleased: true,
-            releaseDate: '2020-11-30',
-            releaseType: 'Maintenance',
-          },
-          {
-            alreadyReleased: true,
-            releaseDate: '2022-04-30',
-            releaseType: 'End-of-life',
-          },
-        ],
-        title: 'v12',
-      },
-      {
-        releases: [
-          {
-            alreadyReleased: true,
-            releaseDate: '2020-04-21',
-            releaseType: 'Current',
-          },
-          {
-            alreadyReleased: true,
-            releaseDate: '2020-10-17',
-            releaseType: 'LTS',
-          },
-          {
-            alreadyReleased: true,
-            releaseDate: '2021-10-19',
-            releaseType: 'Maintenance',
-          },
-          {
-            alreadyReleased: false,
-            releaseDate: '2023-04-30',
-            releaseType: 'End-of-life',
-          },
-        ],
-        title: 'v14',
-      },
-      {
-        releases: [
-          {
-            alreadyReleased: true,
-            releaseDate: '2022-04-19',
-            releaseType: 'Current',
-          },
-          {
-            alreadyReleased: false,
-            releaseDate: '2022-10-25',
-            releaseType: 'LTS',
-          },
-          {
-            alreadyReleased: false,
-            releaseDate: '2023-10-18',
-            releaseType: 'Maintenance',
-          },
-          {
-            alreadyReleased: false,
-            releaseDate: '2025-04-30',
-            releaseType: 'End-of-life',
-          },
-        ],
-        title: 'v18',
-      },
-    ]);
+    ).toMatchSnapshot();
   });
 });
diff --git a/util-node/__tests__/__snapshots__/getNodeReleasesData.test.ts.snap b/util-node/__tests__/__snapshots__/getNodeReleasesData.test.ts.snap
index 17d0491e..e34580da 100644
--- a/util-node/__tests__/__snapshots__/getNodeReleasesData.test.ts.snap
+++ b/util-node/__tests__/__snapshots__/getNodeReleasesData.test.ts.snap
@@ -1,3 +1,3 @@
 // Jest Snapshot v1, https://goo.gl/fbAQLP
 
-exports[`getNodeReleasesData should retrieve data from correct URL 1`] = `"{"nodeReleasesData":[{"fullVersion":"vv0.8","codename":"v0.8","isLts":false,"status":"Pending","initialRelease":"","ltsStart":"","maintenanceStart":"","endOfLife":""},{"fullVersion":"vv0.10","codename":"v0.10","isLts":false,"status":"Pending","initialRelease":"","ltsStart":"","maintenanceStart":"","endOfLife":""},{"fullVersion":"v0.8","version":"v0.8","codename":"v0.8","isLts":false,"status":"End-of-life","initialRelease":"2012-06-25","ltsStart":"","maintenanceStart":"","endOfLife":"2014-07-31"},{"fullVersion":"v0.10","version":"v0.10","codename":"v0.10","isLts":false,"status":"Current","initialRelease":"2013-03-11","ltsStart":"","maintenanceStart":"","endOfLife":"9999-01-01"}],"apiAvailableVersions":["v18","v19"]}"`;
+exports[`getNodeReleasesData should retrieve data from correct URL 1`] = `"{"nodeReleasesData":[{"fullVersion":"vv0.8","codename":"v0.8","isLts":false,"status":"Pending","initialRelease":"","ltsStart":"","maintenanceStart":"","endOfLife":""},{"fullVersion":"vv0.10","codename":"v0.10","isLts":false,"status":"Pending","initialRelease":"","ltsStart":"","maintenanceStart":"","endOfLife":""},{"fullVersion":"v0.8","version":"v0.8","codename":"v0.8","isLts":false,"status":"End-of-life","initialRelease":"2012-06-25","ltsStart":"","maintenanceStart":"","endOfLife":"2014-07-31"},{"fullVersion":"v0.10","version":"v0.10","codename":"v0.10","isLts":false,"status":"Current","initialRelease":"2013-03-11","ltsStart":"","maintenanceStart":"","endOfLife":"9999-01-01"}],"apiAvailableVersions":["v16","v18","v19"]}"`;