From 17a63a6cc7d59668cba130717caaa09749e1f616 Mon Sep 17 00:00:00 2001 From: Yuliia Naumenko Date: Mon, 23 Aug 2021 17:54:04 -0700 Subject: [PATCH] added more tests --- .../server/saved_objects/migrations.test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/x-pack/plugins/task_manager/server/saved_objects/migrations.test.ts b/x-pack/plugins/task_manager/server/saved_objects/migrations.test.ts index 1e2b1c8e94f05..e35b71458df8d 100644 --- a/x-pack/plugins/task_manager/server/saved_objects/migrations.test.ts +++ b/x-pack/plugins/task_manager/server/saved_objects/migrations.test.ts @@ -81,6 +81,22 @@ describe('successful migrations', () => { }, }); }); + + test('skip transformation for defult space scenario', () => { + const migration800 = getMigrations()['8.0.0']; + const taskInstance = getMockData({ + taskType: 'alerting:123456', + params: JSON.stringify({ spaceId: 'default', alertId: '123456' }), + }); + + expect(migration800(taskInstance, migrationContext)).toEqual({ + ...taskInstance, + attributes: { + ...taskInstance.attributes, + params: '{"spaceId":"default","alertId":"123456"}', + }, + }); + }); }); });