import { shallow } from 'enzyme'
import { MockedProvider } from '@apollo/client/testing'

import DeleteUserButton from '../DeleteUserButton'
import { UserDeleteDocument } from '../../../gql'

const mocks = [
  {
    request: {
      query: UserDeleteDocument,
      variables: {
        id: '12'
      }
    },
    result: {
      data: {
        user: { id: '12' }
      }
    }
  }
]

describe('testing delete user button', () => {
  it('renders properly', () => {
    const component = shallow(
      <MockedProvider mocks={mocks} addTypename={false}>
        <DeleteUserButton title='Delete' user={{ id: '12' }} />
      </MockedProvider>
    )
  })
})