zepio/__tests__/utils/filter-object-null-keys.tes...

24 lines
506 B
JavaScript

// @flow
import 'jest-dom/extend-expect';
import { filterObjectNullKeys } from '../../app/utils/filter-object-null-keys';
describe('filterObjectNullKeys', () => {
test('should filter null keys from object', () => {
const initialState = {
name: 'John Doe',
address: null,
amount: 0,
transactions: undefined,
};
const expectedState = {
name: 'John Doe',
amount: 0,
};
expect(filterObjectNullKeys(initialState)).toEqual(expectedState);
});
});