Skip to content

Commit

Permalink
Fixed test (deephaven#1909)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmingles committed Apr 2, 2024
1 parent fa241f1 commit b696bd1
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { renderHook } from '@testing-library/react-hooks';
import type { dh } from '@deephaven/jsapi-types';
import { TestUtils } from '@deephaven/utils';
import { usePickerItemRowDeserializer } from './useItemRowDeserializer';
import { getPickerKeyColumn, getPickerLabelColumn } from './collectionUtils';
import { useItemRowDeserializer } from './useItemRowDeserializer';
import { getItemKeyColumn, getItemLabelColumn } from './itemUtils';

jest.mock('./PickerUtils');
jest.mock('./itemUtils');

const { asMock, createMockProxy } = TestUtils;

Expand All @@ -13,7 +13,7 @@ beforeEach(() => {
expect.hasAssertions();
});

describe('usePickerItemRowDeserializer', () => {
describe('useItemRowDeserializer', () => {
const table = createMockProxy<dh.Table>();
const row = createMockProxy<dh.Row>();
const keyColumnName = 'mock.keyColumnName';
Expand All @@ -25,8 +25,8 @@ describe('usePickerItemRowDeserializer', () => {
const formatValue = jest.fn().mockName('formatValue');

beforeEach(() => {
asMock(getPickerKeyColumn).mockReturnValue(keyColumn);
asMock(getPickerLabelColumn).mockReturnValue(labelColumn);
asMock(getItemKeyColumn).mockReturnValue(keyColumn);
asMock(getItemLabelColumn).mockReturnValue(labelColumn);
asMock(formatValue).mockReturnValue(formattedValue);
});

Expand Down Expand Up @@ -99,16 +99,16 @@ describe('usePickerItemRowDeserializer', () => {
);

const { result } = renderHook(() =>
usePickerItemRowDeserializer({
useItemRowDeserializer({
table,
keyColumnName,
labelColumnName,
formatValue: givenFormatValue,
})
);

expect(getPickerKeyColumn).toHaveBeenCalledWith(table, keyColumnName);
expect(getPickerLabelColumn).toHaveBeenCalledWith(
expect(getItemKeyColumn).toHaveBeenCalledWith(table, keyColumnName);
expect(getItemLabelColumn).toHaveBeenCalledWith(
table,
keyColumn,
labelColumnName
Expand Down

0 comments on commit b696bd1

Please sign in to comment.