From 27ffd7b0cf4bbaad36a1f48a573336fb0ee9e68c Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Mon, 15 Jan 2024 15:16:59 +0100 Subject: [PATCH] test: first test regex path that was filtering out component jest tests (#482) A recent change to the jest configuration caused only the tests in src/modules to be run. As a result of this, some component test snapshots were no longer valid when the new chip design was released. --- jest.config.js | 2 +- .../__tests__/__snapshots__/ChipBase.spec.js.snap | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/jest.config.js b/jest.config.js index a407c8476..f6e031b10 100644 --- a/jest.config.js +++ b/jest.config.js @@ -50,7 +50,7 @@ module.exports = { '\\.(css)$': 'identity-obj-proxy', }, testRunner: 'jest-circus/runner', - testRegex: ['/src/modules/__tests__/.*.spec.js?$'], + testRegex: ['/src/(.*/)?__tests__/.*.spec.js?$'], reporters: [ 'default', ...(isReportPortalSetup ? [reportPortalConfig] : []), diff --git a/src/components/Layout/__tests__/__snapshots__/ChipBase.spec.js.snap b/src/components/Layout/__tests__/__snapshots__/ChipBase.spec.js.snap index 48c520aeb..3197f1c33 100644 --- a/src/components/Layout/__tests__/__snapshots__/ChipBase.spec.js.snap +++ b/src/components/Layout/__tests__/__snapshots__/ChipBase.spec.js.snap @@ -31,6 +31,7 @@ exports[`ChipBase Data element: 2 conditions 1`] = ` 2 @@ -69,6 +70,7 @@ exports[`ChipBase Data element: TRUE_ONLY 1 condition 1`] = ` 1 @@ -107,6 +109,7 @@ exports[`ChipBase Data element: TRUE_ONLY both selected 1`] = ` all @@ -145,6 +148,7 @@ exports[`ChipBase Data element: TRUE_ONLY no conditions 1`] = ` all @@ -180,6 +184,9 @@ exports[`ChipBase Data element: in stage with option set and 2 options chosen 1` > My data element + + , + @@ -188,6 +195,7 @@ exports[`ChipBase Data element: in stage with option set and 2 options chosen 1` 2 @@ -226,6 +234,7 @@ exports[`ChipBase Data element: no conditions 1`] = ` all @@ -264,6 +273,7 @@ exports[`ChipBase Data element: option set and 2 options chosen 1`] = ` 2 @@ -302,6 +312,7 @@ exports[`ChipBase OU: 2 selected 1`] = ` 2 @@ -338,7 +349,6 @@ exports[`ChipBase OU: none selected 1`] = ` Organsiation unit - `; @@ -374,6 +384,7 @@ exports[`ChipBase Period: 1 selected 1`] = ` 1 @@ -410,7 +421,6 @@ exports[`ChipBase Period: none selected 1`] = ` Event date (e2e) - `;