-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make sure migrations stay in sync (#101362)
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
x-pack/plugins/lens/server/embeddable/lens_embeddable_factory.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import semverGte from 'semver/functions/gte'; | ||
import { lensEmbeddableFactory } from './lens_embeddable_factory'; | ||
import { migrations } from '../migrations/saved_object_migrations'; | ||
|
||
describe('saved object migrations and embeddable migrations', () => { | ||
test('should have same versions registered (>7.13.0)', () => { | ||
const savedObjectMigrationVersions = Object.keys(migrations).filter((version) => { | ||
return semverGte(version, '7.13.1'); | ||
}); | ||
const embeddableMigrationVersions = lensEmbeddableFactory()?.migrations; | ||
if (embeddableMigrationVersions) { | ||
expect(savedObjectMigrationVersions.sort()).toEqual( | ||
Object.keys(embeddableMigrationVersions).sort() | ||
); | ||
} | ||
}); | ||
}); |