add.mocks.ts 755 B

1234567891011121314151617
  1. import * as Types from '#shared/graphql/types.ts';
  2. import * as Mocks from '#tests/graphql/builders/mocks.ts'
  3. import * as Operations from './add.api.ts'
  4. import * as ErrorTypes from '#shared/types/error.ts'
  5. export function mockUserAddMutation(defaults: Mocks.MockDefaultsValue<Types.UserAddMutation, Types.UserAddMutationVariables>) {
  6. return Mocks.mockGraphQLResult(Operations.UserAddDocument, defaults)
  7. }
  8. export function waitForUserAddMutationCalls() {
  9. return Mocks.waitForGraphQLMockCalls<Types.UserAddMutation>(Operations.UserAddDocument)
  10. }
  11. export function mockUserAddMutationError(message: string, extensions: {type: ErrorTypes.GraphQLErrorTypes }) {
  12. return Mocks.mockGraphQLResultWithError(Operations.UserAddDocument, message, extensions);
  13. }