aboutsummaryrefslogtreecommitdiffstats
path: root/tests/msw/handlers/thematics/thematics-list.handler.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/msw/handlers/thematics/thematics-list.handler.ts')
-rw-r--r--tests/msw/handlers/thematics/thematics-list.handler.ts11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/msw/handlers/thematics/thematics-list.handler.ts b/tests/msw/handlers/thematics/thematics-list.handler.ts
index f206247..7afec4c 100644
--- a/tests/msw/handlers/thematics/thematics-list.handler.ts
+++ b/tests/msw/handlers/thematics/thematics-list.handler.ts
@@ -23,12 +23,17 @@ export const thematicsListHandler = graphql.query<
variableValues: variables,
rootValue: {
thematics({ after, first, where }: typeof variables) {
- const { search, title } = where ?? {};
+ const { notIn, search, title } = where ?? {};
+ const filteredThematicsById = notIn
+ ? wpThematicsFixture.filter(
+ (thematic) => !notIn.includes(thematic.databaseId)
+ )
+ : wpThematicsFixture;
const filteredThematicsByTitle = title
- ? wpThematicsFixture.filter((thematic) =>
+ ? filteredThematicsById.filter((thematic) =>
thematic.title.includes(title)
)
- : wpThematicsFixture;
+ : filteredThematicsById;
const filteredThematics = search
? filteredThematicsByTitle.filter((thematic) =>
thematic.title.includes(search)