Skip to content

Commit

Permalink
fix failed test case
Browse files Browse the repository at this point in the history
Signed-off-by: Hailong Cui <ihailong@amazon.com>
  • Loading branch information
Hailong-am committed Mar 1, 2024
1 parent c5e3ab2 commit f54318b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ describe('SavedObjectsTable', () => {
expect(component.state('selectedSavedObjects').length).toBe(0);
});

it('show workspace filter when workspace on and not in a workspace', async () => {
it('show workspace filter when workspace turn on and not in any workspace', async () => {
const applications = applicationServiceMock.createStartContract();
applications.capabilities = {
navLinks: {},
Expand All @@ -675,6 +675,8 @@ describe('SavedObjectsTable', () => {
},
];
workspaces.workspaceList$.next(workspaceList);
workspaces.currentWorkspaceId$.next('');
workspaces.currentWorkspace$.next(null);

const component = shallowRender({ applications, workspaces });

Expand All @@ -693,7 +695,7 @@ describe('SavedObjectsTable', () => {
expect(filters[1].options[1].value).toBe('bar');
});

it('show workspace filter when workspace on and in a workspace', async () => {
it('show workspace filter when workspace turn on and enter a workspace', async () => {
const applications = applicationServiceMock.createStartContract();
applications.capabilities = {
navLinks: {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export class SavedObjectsTable extends Component<SavedObjectsTableProps, SavedOb

private get wsNameIdLookup() {
const { availableWorkspaces } = this.state;
// Assumption: workspace name is unique across the system
// Assumption: workspace name is unique across the system
return availableWorkspaces?.reduce((map, ws) => {
return map.set(ws.name, ws.id);
}, new Map<string, string>());
Expand Down

0 comments on commit f54318b

Please sign in to comment.