From d85bf14de86d0f69d733fe77e3480bca19e318db Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Sat, 2 Mar 2024 11:07:08 +0800 Subject: [PATCH] feat: fix unit test Signed-off-by: SuZhou-Joe --- .../saved_objects/migrations/core/index_migrator.test.ts | 6 +----- .../opensearch_dashboards_migrator.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/core/server/saved_objects/migrations/core/index_migrator.test.ts b/src/core/server/saved_objects/migrations/core/index_migrator.test.ts index 72d0afaacc70..7ed60b0aa526 100644 --- a/src/core/server/saved_objects/migrations/core/index_migrator.test.ts +++ b/src/core/server/saved_objects/migrations/core/index_migrator.test.ts @@ -60,7 +60,7 @@ describe('IndexMigrator', () => { }; }); - test('creates the index when permission control for saved objects is enabled', async () => { + test('creates the index when workspaces feature flag is enabled', async () => { const { client } = testOpts; testOpts.mappingProperties = { foo: { type: 'long' } as any }; @@ -254,7 +254,6 @@ describe('IndexMigrator', () => { references: '7997cf5a56cc02bdc9c93361bde732b0', type: '2f4316de49999235636386fe51dc06c1', updated_at: '00da57df13e94e9d98437d13ace4bfe0', - workspaces: '2f4316de49999235636386fe51dc06c1', }, }, properties: { @@ -274,7 +273,6 @@ describe('IndexMigrator', () => { id: { type: 'keyword' }, }, }, - workspaces: { type: 'keyword' }, }, }, settings: { number_of_shards: 1, auto_expand_replicas: '0-1' }, @@ -317,7 +315,6 @@ describe('IndexMigrator', () => { references: '7997cf5a56cc02bdc9c93361bde732b0', type: '2f4316de49999235636386fe51dc06c1', updated_at: '00da57df13e94e9d98437d13ace4bfe0', - workspaces: '2f4316de49999235636386fe51dc06c1', }, }, properties: { @@ -337,7 +334,6 @@ describe('IndexMigrator', () => { id: { type: 'keyword' }, }, }, - workspaces: { type: 'keyword' }, }, }, settings: { number_of_shards: 1, auto_expand_replicas: '0-1' }, diff --git a/src/core/server/saved_objects/migrations/opensearch_dashboards/opensearch_dashboards_migrator.test.ts b/src/core/server/saved_objects/migrations/opensearch_dashboards/opensearch_dashboards_migrator.test.ts index 794a49761915..ecb3ccb9cd3e 100644 --- a/src/core/server/saved_objects/migrations/opensearch_dashboards/opensearch_dashboards_migrator.test.ts +++ b/src/core/server/saved_objects/migrations/opensearch_dashboards/opensearch_dashboards_migrator.test.ts @@ -78,10 +78,10 @@ describe('OpenSearchDashboardsMigrator', () => { expect(mappings).toMatchSnapshot(); }); - it('permissions field exists in the mappings when the feature is enabled', () => { + it('workspaces field exists in the mappings when the feature is enabled', () => { const options = mockOptions(true); const mappings = new OpenSearchDashboardsMigrator(options).getActiveMappings(); - expect(mappings).toHaveProperty('properties.permissions'); + expect(mappings).toHaveProperty('properties.workspaces'); }); });