mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-05-31 14:11:58 +05:30
Fix all tests and replace enzyme with @testing-library/react
This commit is contained in:
@@ -4,7 +4,9 @@ import request from 'app/services/request';
|
||||
import options from './options';
|
||||
|
||||
describe('services/api/options', () => {
|
||||
const expectedResp = { foo: 'bar' };
|
||||
const expectedResp = {
|
||||
foo: 'bar',
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
sinon
|
||||
@@ -24,7 +26,10 @@ describe('services/api/options', () => {
|
||||
|
||||
it('should request options without token', () =>
|
||||
options.get().then((resp) => {
|
||||
expect(resp, 'to be', expectedResp);
|
||||
expect(resp, 'to satisfy', {
|
||||
...expectedResp,
|
||||
originalResponse: expect.it('to be a', Response),
|
||||
});
|
||||
expect(request.get, 'to have a call satisfying', [
|
||||
'/api/options',
|
||||
{},
|
||||
@@ -36,7 +41,10 @@ describe('services/api/options', () => {
|
||||
// NOTE: this is bad practice, but we are relying on the state from
|
||||
// the previous test
|
||||
options.get().then((resp) => {
|
||||
expect(resp, 'to be', expectedResp);
|
||||
expect(resp, 'to satisfy', {
|
||||
...expectedResp,
|
||||
originalResponse: expect.it('to be a', Response),
|
||||
});
|
||||
expect(request.get, 'was not called');
|
||||
}));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user