Skip to content

Commit

Permalink
[Visualize] Adds a unit test to compare the by value and by ref migra…
Browse files Browse the repository at this point in the history
…tions (elastic#101247) (elastic#101359)

* [Visualize] Add unti test to compare the by value and by ref migrations

* Fix file name

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
stratoula and kibanamachine authored Jun 4, 2021
1 parent c579429 commit 07706a3
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import semverGte from 'semver/functions/gte';
import { visualizeEmbeddableFactory } from './visualize_embeddable_factory';
import { visualizationSavedObjectTypeMigrations } from '../migrations/visualization_saved_object_migrations';

describe('saved object migrations and embeddable migrations', () => {
test('should have same versions registered (>7.13.0)', () => {
const savedObjectMigrationVersions = Object.keys(visualizationSavedObjectTypeMigrations).filter(
(version) => {
return semverGte(version, '7.13.1');
}
);
const embeddableMigrationVersions = visualizeEmbeddableFactory()?.migrations;
if (embeddableMigrationVersions) {
expect(savedObjectMigrationVersions.sort()).toEqual(
Object.keys(embeddableMigrationVersions).sort()
);
}
});
});

0 comments on commit 07706a3

Please sign in to comment.