Skip to content
This repository has been archived by the owner on Jun 11, 2022. It is now read-only.

refactor into urql-mocks #48

Open
github-actions bot opened this issue Jun 4, 2022 · 0 comments
Open

refactor into urql-mocks #48

github-actions bot opened this issue Jun 4, 2022 · 0 comments
Labels
todo Auto-generated from TODO comments

Comments

@github-actions
Copy link

github-actions bot commented Jun 4, 2022

import { ref } from 'vue'
import { mount } from '@vue/test-utils'
import { fromValue, never } from 'wonka'
import { Quasar } from 'quasar'
import AddMemberView from './add-member.vue'

// TODO: refactor into urql-mocks

const querySpy = vi.fn(() => fromValue({}))
const mutationSpy = vi.fn(() => never)

const wrapperFactory = () =>
  mount(AddMemberView, {
    global: {
      plugins: [Quasar],
      provide: {
        $urql: ref({
          executeQuery: querySpy,
          executeMutation: mutationSpy,
          executeSubscription: vi.fn(() => never),
        }),
      },
    },
  })

describe('AddMember', () => {
  it('renders', () => {
    const wrapper = wrapperFactory()
    expect(wrapper).toBeDefined()
  })
})
@github-actions github-actions bot added the todo Auto-generated from TODO comments label Jun 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
todo Auto-generated from TODO comments
Projects
None yet
Development

No branches or pull requests

0 participants