locales.mocks.ts 741 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 './locales.api.ts'
  4. import * as ErrorTypes from '#shared/types/error.ts'
  5. export function mockLocalesQuery(defaults: Mocks.MockDefaultsValue<Types.LocalesQuery, Types.LocalesQueryVariables>) {
  6. return Mocks.mockGraphQLResult(Operations.LocalesDocument, defaults)
  7. }
  8. export function waitForLocalesQueryCalls() {
  9. return Mocks.waitForGraphQLMockCalls<Types.LocalesQuery>(Operations.LocalesDocument)
  10. }
  11. export function mockLocalesQueryError(message: string, extensions: {type: ErrorTypes.GraphQLErrorTypes }) {
  12. return Mocks.mockGraphQLResultWithError(Operations.LocalesDocument, message, extensions);
  13. }