Skip to content

Commit

Permalink
Add test about name regex filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorblades committed Sep 14, 2023
1 parent b11d0f7 commit 57c5427
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/graphql.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,23 @@ it("returns filtered data", async () => {
expect(result.data?.countries).toHaveLength(2);
});

it("filters names using a regular expression", async () => {
const result = await executor({
document: query,
variables: {
filter: {
name: {
regex: "^United",
},
},
},
});

assertSingleValue(result);

expect(result.data?.countries).toHaveLength(3);
});

it("filters a single value", async () => {
const result = await executor({
document: query,
Expand Down

0 comments on commit 57c5427

Please sign in to comment.