-
Notifications
You must be signed in to change notification settings - Fork 916
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'visualize_link_fix' of github.com:BSFishy/OpenSearch-Da…
…shboards into visualize_link_fix
- Loading branch information
Showing
14 changed files
with
315 additions
and
24 deletions.
There are no files selected for viewing
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
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
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
138 changes: 132 additions & 6 deletions
138
...plugins/dashboard/public/application/listing/__snapshots__/dashboard_listing.test.js.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
61 changes: 61 additions & 0 deletions
61
src/plugins/saved_objects/public/saved_object/saved_object_loader.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,61 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { SavedObjectsClientContract } from 'opensearch-dashboards/public'; | ||
import { SavedObjectLoader } from './saved_object_loader'; | ||
|
||
describe('SimpleSavedObjectLoader', () => { | ||
const createLoader = (updatedAt?: any) => { | ||
const id = 'logstash-*'; | ||
const type = 'index-pattern'; | ||
|
||
const savedObject = { | ||
attributes: {}, | ||
id, | ||
type, | ||
updated_at: updatedAt as any, | ||
}; | ||
|
||
client = { | ||
...client, | ||
find: jest.fn(() => | ||
Promise.resolve({ | ||
total: 1, | ||
savedObjects: [savedObject], | ||
}) | ||
), | ||
} as any; | ||
|
||
return new SavedObjectLoader(savedObject, client); | ||
}; | ||
|
||
let client: SavedObjectsClientContract; | ||
let loader: SavedObjectLoader; | ||
beforeEach(() => { | ||
client = { | ||
update: jest.fn(), | ||
create: jest.fn(), | ||
delete: jest.fn(), | ||
} as any; | ||
}); | ||
|
||
afterEach(async () => { | ||
const savedObjects = await loader.findAll(); | ||
|
||
expect(savedObjects.hits[0].updated_at).toEqual(undefined); | ||
}); | ||
|
||
it('set updated_at as undefined if undefined', async () => { | ||
loader = createLoader(undefined); | ||
}); | ||
|
||
it("set updated_at as undefined if doesn't exist", async () => { | ||
loader = createLoader(); | ||
}); | ||
|
||
it('set updated_at as undefined if null', async () => { | ||
loader = createLoader(null); | ||
}); | ||
}); |
Oops, something went wrong.