Skip to content

Commit

Permalink
Update tests for filtered filters
Browse files Browse the repository at this point in the history
  • Loading branch information
TomHAnderson committed Mar 29, 2024
1 parent 419a979 commit b9a156b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions test/Feature/Filter/ConfigExcludeFiltersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,28 +47,28 @@ public function testConfigExcludeFilters(): void
$result = GraphQL::executeQuery($schema, $query);

foreach ($result->errors as $error) {
$this->assertEquals('Field "eq" is not defined by type "Filters_String_b26f464f97a76891491eafa1573acb24".', $error->getMessage());
$this->assertEquals('Field "eq" is not defined by type "Filters_String_0812311810b0ba1d34247150620b78b0".', $error->getMessage());
}

$query = '{ artists (filter: { name: { neq: "Grateful Dead" } } ) { edges { node { name } } } }';
$result = GraphQL::executeQuery($schema, $query);

foreach ($result->errors as $error) {
$this->assertEquals('Field "neq" is not defined by type "Filters_String_b26f464f97a76891491eafa1573acb24".', $error->getMessage());
$this->assertEquals('Field "neq" is not defined by type "Filters_String_0812311810b0ba1d34247150620b78b0".', $error->getMessage());
}

$query = '{ artists { edges { node { performances ( filter: {venue: { neq: "test"} } ) { edges { node { venue } } } } } } }';
$result = GraphQL::executeQuery($schema, $query);

foreach ($result->errors as $error) {
$this->assertEquals('Field "neq" is not defined by type "Filters_String_b26f464f97a76891491eafa1573acb24".', $error->getMessage());
$this->assertEquals('Field "neq" is not defined by type "Filters_String_0812311810b0ba1d34247150620b78b0".', $error->getMessage());
}

$query = '{ artists { edges { node { performances ( filter: {venue: { contains: "test" } } ) { edges { node { venue } } } } } } }';
$result = GraphQL::executeQuery($schema, $query);

foreach ($result->errors as $error) {
$this->assertEquals('Field "contains" is not defined by type "Filters_String_b26f464f97a76891491eafa1573acb24". Did you mean "notin"?', $error->getMessage());
$this->assertEquals('Field "contains" is not defined by type "Filters_String_0812311810b0ba1d34247150620b78b0". Did you mean "notin"?', $error->getMessage());
}
}
}
8 changes: 4 additions & 4 deletions test/Feature/Filter/ExcludeFiltersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,28 @@ public function testExcludeCriteria(): void
$result = GraphQL::executeQuery($schema, $query);

foreach ($result->errors as $error) {
$this->assertEquals('Field "eq" is not defined by type "Filters_String_436fb9911a1f07ad8eb7057c1a8e3d2b".', $error->getMessage());
$this->assertEquals('Field "eq" is not defined by type "Filters_String_a03586330c4e7326edac556450d913ee".', $error->getMessage());
}

$query = '{ artists (filter: { name: { neq: "Grateful Dead" } } ) { edges { node { name } } } }';
$result = GraphQL::executeQuery($schema, $query);

foreach ($result->errors as $error) {
$this->assertEquals('Field "neq" is not defined by type "Filters_String_436fb9911a1f07ad8eb7057c1a8e3d2b".', $error->getMessage());
$this->assertEquals('Field "neq" is not defined by type "Filters_String_a03586330c4e7326edac556450d913ee".', $error->getMessage());
}

$query = '{ artists { edges { node { performances ( filter: {venue: { neq: "test"} } ) { edges { node { venue } } } } } } }';
$result = GraphQL::executeQuery($schema, $query);

foreach ($result->errors as $error) {
$this->assertEquals('Field "neq" is not defined by type "Filters_String_bef569e688f8bb56acb1e0e4e430b055". Did you mean "eq"?', $error->getMessage());
$this->assertEquals('Field "neq" is not defined by type "Filters_String_e55a7b533af3c46236f06d0fb99f08c6". Did you mean "eq"?', $error->getMessage());
}

$query = '{ artists { edges { node { performances ( filter: {venue: { contains: "test" } } ) { edges { node { venue } } } } } } }';
$result = GraphQL::executeQuery($schema, $query);

foreach ($result->errors as $error) {
$this->assertEquals('Field "contains" is not defined by type "Filters_String_bef569e688f8bb56acb1e0e4e430b055". Did you mean "notin"?', $error->getMessage());
$this->assertEquals('Field "contains" is not defined by type "Filters_String_e55a7b533af3c46236f06d0fb99f08c6". Did you mean "notin"?', $error->getMessage());
}
}
}

0 comments on commit b9a156b

Please sign in to comment.