From f54318b669c78870850506c9e4ca7dcbc6005585 Mon Sep 17 00:00:00 2001 From: Hailong Cui Date: Fri, 1 Mar 2024 15:34:26 +0800 Subject: [PATCH] fix failed test case Signed-off-by: Hailong Cui --- .../objects_table/saved_objects_table.test.tsx | 6 ++++-- .../objects_table/saved_objects_table.tsx | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.test.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.test.tsx index a825d777e73..db12d5f61bd 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.test.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.test.tsx @@ -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: {}, @@ -675,6 +675,8 @@ describe('SavedObjectsTable', () => { }, ]; workspaces.workspaceList$.next(workspaceList); + workspaces.currentWorkspaceId$.next(''); + workspaces.currentWorkspace$.next(null); const component = shallowRender({ applications, workspaces }); @@ -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: {}, diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx index 6ab864fa81f..b9225db2088 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx @@ -202,7 +202,7 @@ export class SavedObjectsTable extends Component { return map.set(ws.name, ws.id); }, new Map());