mockPublicLinks.ts 774 B

123456789101112131415161718192021222324
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import {
  3. mockGraphQLApi,
  4. mockGraphQLSubscription,
  5. } from '#tests/support/mock-graphql-api.ts'
  6. import type { PublicLinksQuery } from '#shared/graphql/types.ts'
  7. import type { ConfidentTake } from '#shared/types/utils.ts'
  8. import { PublicLinksDocument } from '../../graphql/queries/links.api.ts'
  9. import { PublicLinkUpdatesDocument } from '../../graphql/subscriptions/currentLinks.api.ts'
  10. export const mockPublicLinksSubscription = () => {
  11. return mockGraphQLSubscription(PublicLinkUpdatesDocument)
  12. }
  13. export const mockPublicLinks = (
  14. publicLinks: ConfidentTake<PublicLinksQuery, 'publicLinks'> = [],
  15. ) => {
  16. return mockGraphQLApi(PublicLinksDocument).willResolve({
  17. publicLinks,
  18. })
  19. }