Skip to content

Commit

Permalink
fix all failed ut
Browse files Browse the repository at this point in the history
Signed-off-by: ananzh <ananzh@amazon.com>
  • Loading branch information
ananzh committed Aug 30, 2023
1 parent 1d981e1 commit 26acb3e
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,12 @@ describe('Testing buildDataGridColumns function ', () => {
Array [
Object {
"actions": Object {
"showHide": true,
"showMoveLeft": false,
"showMoveRight": false,
"showHide": Object {
"iconType": "cross",
"label": "Remove column",
},
"showMoveLeft": true,
"showMoveRight": true,
},
"cellActions": undefined,
"display": undefined,
Expand All @@ -69,9 +72,12 @@ describe('Testing buildDataGridColumns function ', () => {
},
Object {
"actions": Object {
"showHide": true,
"showMoveLeft": false,
"showMoveRight": false,
"showHide": Object {
"iconType": "cross",
"label": "Remove column",
},
"showMoveLeft": true,
"showMoveRight": true,
},
"cellActions": undefined,
"display": undefined,
Expand All @@ -98,9 +104,9 @@ describe('Testing buildDataGridColumns function ', () => {
Array [
Object {
"actions": Object {
"showHide": true,
"showMoveLeft": false,
"showMoveRight": false,
"showHide": false,
"showMoveLeft": true,
"showMoveRight": true,
},
"cellActions": undefined,
"display": "Time (order_date)",
Expand All @@ -111,9 +117,12 @@ describe('Testing buildDataGridColumns function ', () => {
},
Object {
"actions": Object {
"showHide": true,
"showMoveLeft": false,
"showMoveRight": false,
"showHide": Object {
"iconType": "cross",
"label": "Remove column",
},
"showMoveLeft": true,
"showMoveRight": true,
},
"cellActions": undefined,
"display": undefined,
Expand All @@ -123,9 +132,12 @@ describe('Testing buildDataGridColumns function ', () => {
},
Object {
"actions": Object {
"showHide": true,
"showMoveLeft": false,
"showMoveRight": false,
"showHide": Object {
"iconType": "cross",
"label": "Remove column",
},
"showMoveLeft": true,
"showMoveRight": true,
},
"cellActions": undefined,
"display": undefined,
Expand All @@ -135,9 +147,9 @@ describe('Testing buildDataGridColumns function ', () => {
},
Object {
"actions": Object {
"showHide": true,
"showMoveLeft": false,
"showMoveRight": false,
"showHide": false,
"showMoveLeft": true,
"showMoveRight": true,
},
"cellActions": undefined,
"display": "Source",
Expand All @@ -162,9 +174,12 @@ describe('Testing buildDataGridColumns function ', () => {
Array [
Object {
"actions": Object {
"showHide": true,
"showMoveLeft": false,
"showMoveRight": false,
"showHide": Object {
"iconType": "cross",
"label": "Remove column",
},
"showMoveLeft": true,
"showMoveRight": true,
},
"cellActions": undefined,
"display": undefined,
Expand All @@ -174,9 +189,12 @@ describe('Testing buildDataGridColumns function ', () => {
},
Object {
"actions": Object {
"showHide": true,
"showMoveLeft": false,
"showMoveRight": false,
"showHide": Object {
"iconType": "cross",
"label": "Remove column",
},
"showMoveLeft": true,
"showMoveRight": true,
},
"cellActions": undefined,
"display": undefined,
Expand All @@ -186,9 +204,9 @@ describe('Testing buildDataGridColumns function ', () => {
},
Object {
"actions": Object {
"showHide": true,
"showMoveLeft": false,
"showMoveRight": false,
"showHide": false,
"showMoveLeft": true,
"showMoveRight": true,
},
"cellActions": undefined,
"display": "Time (order_date)",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { addColumn, removeColumn, reorderColumn, setColumns } from './common';
import { addColumn, removeColumn, reorderColumn } from './common';

describe('commonUtils', () => {
it('should handle addColumn', () => {
Expand All @@ -22,12 +22,4 @@ describe('commonUtils', () => {
'column1',
]);
});

it('should handle setColumns', () => {
expect(setColumns('timeField', ['timeField', 'column1', 'column2'])).toEqual([
'column1',
'column2',
]);
expect(setColumns(undefined, ['column1', 'column2'])).toEqual(['column1', 'column2']);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('discoverSlice', () => {
it('should handle setColumns', () => {
const action = {
type: 'discover/setColumns',
payload: { timeField: 'timeField', columns: ['timeField', 'column1', 'column2'] },
payload: { columns: ['column1', 'column2'] },
};
const result = discoverSlice.reducer(initialState, action);
expect(result.columns).toEqual(['column1', 'column2']);
Expand Down

0 comments on commit 26acb3e

Please sign in to comment.