diff --git a/tests/Integration/Schema/Directives/EnumDirectiveTest.php b/tests/Integration/Schema/Directives/EnumDirectiveTest.php new file mode 100644 index 000000000..f31963b8c --- /dev/null +++ b/tests/Integration/Schema/Directives/EnumDirectiveTest.php @@ -0,0 +1,40 @@ +mockResolver(function ($_, array $args): string { + $this->assertSame('Active internal', $args['status']); + + return 'Not active'; + }); + + $this->schema = /** @lang GraphQL */ ' + enum Status { + ACTIVE @enum(value: "Active internal") + INACTIVE @enum(value: "Not active") + } + + type Query { + status(status: Status!): Status! @mock + } + '; + + $this + ->graphQL(/** @lang GraphQL */ ' + { + status(status: ACTIVE) + } + ') + ->assertExactJson([ + 'data' => [ + 'status' => 'INACTIVE', + ], + ]); + } +}