Skip to content

Commit

Permalink
fix: minor fix by review
Browse files Browse the repository at this point in the history
  • Loading branch information
louisewang1 committed Apr 12, 2022
1 parent 41b3140 commit 6318b5e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/hooks/itemValidation.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable import/no-extraneous-dependencies */
import nock from 'nock';
import { List } from 'immutable';
import { List, Map } from 'immutable';
import { StatusCodes } from 'http-status-codes';
import Cookies from 'js-cookie';
import { mockHook, setUpTest } from '../../test/utils';
Expand Down Expand Up @@ -167,10 +167,10 @@ describe('Item Validation Hooks', () => {
const endpoints = [{ route, response }];
const { data } = await mockHook({ endpoints, hook, wrapper });

expect(data as ItemValidationAndReview).toEqual(response);
expect(data as ItemValidationAndReview).toEqual(Map(response));

// verify cache keys
expect(queryClient.getQueryData(key)).toEqual(response);
expect(queryClient.getQueryData(key)).toEqual(Map(response));
});
it(`Unauthorized`, async () => {
const endpoints = [
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/itemValidation.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useQuery } from 'react-query';
import { List } from 'immutable';
import { List, Map } from 'immutable';
import { QueryClientConfig, UUID } from '../types';
import * as Api from '../api';
import {
Expand Down Expand Up @@ -52,7 +52,7 @@ export default (queryConfig: QueryClientConfig) => {
queryKey: buildItemValidationAndReviewKey(itemId),
queryFn: () =>
Api.getItemValidationAndReview(queryConfig, itemId).then(
(data) => data,
(data) => Map(data),
),
...defaultOptions,
enabled: Boolean(itemId),
Expand Down

0 comments on commit 6318b5e

Please sign in to comment.