Skip to content

Commit

Permalink
Fix types in test
Browse files Browse the repository at this point in the history
  • Loading branch information
wylieconlon committed Apr 8, 2020
1 parent ccdf919 commit e789020
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions x-pack/plugins/lens/server/migrations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
*/

import { migrations, RawLensSavedXYObject770 } from './migrations';
import { SimpleSavedObject } from 'src/core/public';
import { SavedObjectUnsanitizedDoc } from 'src/core/server';

describe('Lens migrations', () => {
describe('7.7.0 missing dimensions in XY', () => {
const migrate = (doc: SimpleSavedObject | RawLensSavedXYObject770) => migrations['7.7.0'](doc);
const migrate = (doc: SavedObjectUnsanitizedDoc | RawLensSavedXYObject770) =>
migrations['7.7.0'](doc);

const example: RawLensSavedXYObject770 = {
type: 'lens',
Expand Down Expand Up @@ -106,7 +107,7 @@ describe('Lens migrations', () => {
visualizationType: 'lnsMetric',
},
};
const result = migrate(target as SimpleSavedObject);
const result = migrate(target as SavedObjectUnsanitizedDoc);
expect(result).toEqual(target);
});

Expand All @@ -124,7 +125,7 @@ describe('Lens migrations', () => {
},
},
},
} as SimpleSavedObject) as RawLensSavedXYObject770;
} as SavedObjectUnsanitizedDoc) as RawLensSavedXYObject770;

expect(result.attributes.state.visualization.layers).toEqual([
{
Expand Down

0 comments on commit e789020

Please sign in to comment.