Skip to content

Commit

Permalink
Fix imports, build warning and unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jerolimov committed Jun 3, 2022
1 parent 742f383 commit 463deec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions frontend/public/components/utils/__tests__/firehose.spec.tsx
Expand Up @@ -1049,10 +1049,10 @@ describe('Firehose together with useK8sWatchResources', () => {
expect(lastFirehoseChildProps.pod.data).toEqual(lastUseResourcesHookResult.pod.data);

// And they also should return the same instance for lists
expect(lastFirehoseChildProps.pods.data).not.toBe(lastUseResourcesHookResult.pods.data); // Could be the same!
expect(lastFirehoseChildProps.pods.data[0]).not.toBe(lastUseResourcesHookResult.pods.data[0]); // Should be the same!!!
expect(lastFirehoseChildProps.pods.data[1]).not.toBe(lastUseResourcesHookResult.pods.data[1]); // Should be the same!!!
expect(lastFirehoseChildProps.pods.data[2]).not.toBe(lastUseResourcesHookResult.pods.data[2]); // Should be the same!!!
expect(lastFirehoseChildProps.pods.data).toBe(lastUseResourcesHookResult.pods.data);
expect(lastFirehoseChildProps.pods.data[0]).toBe(lastUseResourcesHookResult.pods.data[0]);
expect(lastFirehoseChildProps.pods.data[1]).toBe(lastUseResourcesHookResult.pods.data[1]);
expect(lastFirehoseChildProps.pods.data[2]).toBe(lastUseResourcesHookResult.pods.data[2]);

// And they also should return the same instance for single items
expect(lastFirehoseChildProps.pod.data).not.toBe(lastUseResourcesHookResult.pod.data); // Should be the same, or?
Expand Down Expand Up @@ -1137,10 +1137,10 @@ describe('Firehose together with useK8sWatchResources', () => {
expect(lastFirehoseChildProps.pod.data).toEqual(lastUseResourcesHookResult.pod.data);

// And they also should return the same instance for lists
expect(lastFirehoseChildProps.pods.data).not.toBe(lastUseResourcesHookResult.pods.data); // Could be the same!
expect(lastFirehoseChildProps.pods.data[0]).not.toBe(lastUseResourcesHookResult.pods.data[0]); // Should be the same!!!
expect(lastFirehoseChildProps.pods.data[1]).not.toBe(lastUseResourcesHookResult.pods.data[1]); // Should be the same!!!
expect(lastFirehoseChildProps.pods.data[2]).not.toBe(lastUseResourcesHookResult.pods.data[2]); // Should be the same!!!
expect(lastFirehoseChildProps.pods.data).toBe(lastUseResourcesHookResult.pods.data);
expect(lastFirehoseChildProps.pods.data[0]).toBe(lastUseResourcesHookResult.pods.data[0]);
expect(lastFirehoseChildProps.pods.data[1]).toBe(lastUseResourcesHookResult.pods.data[1]);
expect(lastFirehoseChildProps.pods.data[2]).toBe(lastUseResourcesHookResult.pods.data[2]);

// And they also should return the same instance for single items
expect(lastFirehoseChildProps.pod.data).not.toBe(lastUseResourcesHookResult.pod.data); // Should be the same, or?
Expand Down
2 changes: 1 addition & 1 deletion frontend/public/components/utils/firehose.jsx
Expand Up @@ -10,7 +10,7 @@ import * as k8sActions from '../../actions/k8s';
import {
INTERNAL_REDUX_IMMUTABLE_TOARRAY_CACHE_SYMBOL,
INTERNAL_REDUX_IMMUTABLE_TOJSON_CACHE_SYMBOL,
} from '@console/dynamic-plugin-sdk';
} from './k8s-watch-hook';

const shallowMapEquals = (a, b) => {
if (a === b || (a.size === 0 && b.size === 0)) {
Expand Down

0 comments on commit 463deec

Please sign in to comment.