refactor(deleted extra file)

Co-authored-by: Sebastian Palmqvist <PalmN72@users.noreply.github.com>
This commit is contained in:
Lee 2023-10-24 10:19:50 +02:00
parent 74291295f3
commit bad26e739a
1 changed files with 0 additions and 29 deletions

View File

@ -1,29 +0,0 @@
import React from 'react'
import { render } from '@testing-library/react'
import { ApiProvider } from './provider'
import init from './__mocks__/@skolplattformen/embedded-api'
import { useApi } from './context'
describe('ApiProvider', () => {
const Login = () => {
const { isLoggedIn } = useApi()
return (
<div>
<div data-testid="isLoggedIn">{isLoggedIn ? 'y' : 'n'}</div>
</div>
)
}
let api
beforeEach(() => {
api = init()
})
it('enables useApi()', () => {
const { getByTestId } = render(
<ApiProvider api={api}>
<Login />
</ApiProvider>
)
expect(getByTestId('isLoggedIn').textContent).toEqual('n')
})
})