Skip to content

Commit

Permalink
types
Browse files Browse the repository at this point in the history
  • Loading branch information
mbondyra committed Mar 5, 2020
1 parent 770d241 commit 61f2b35
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,17 +272,15 @@ describe('IndexPattern Data Panel', () => {
});

describe('loading existence data', () => {
function waitForPromises() {
return Promise.resolve()
.catch(() => {})
.then(() => {})
.then(() => {});
}
const waitForPromises = async () =>
act(async () => {
await new Promise(resolve => setTimeout(resolve));
});

function testProps() {
const setState = jest.fn();
core.http.post.mockImplementation(async path => {
const parts = path.split && path.split('/');
core.http.post.mockImplementation(async (path) => {
const parts = (path as unknown as string).split('/');
const indexPatternTitle = parts[parts.length - 1];
return {
indexPatternTitle: `${indexPatternTitle}_testtitle`,
Expand Down Expand Up @@ -497,7 +495,7 @@ describe('IndexPattern Data Panel', () => {
}
++queryCount;

const parts = path.split && path.split('/');
const parts = (path as unknown as string).split('/');
const indexPatternTitle = parts[parts.length - 1];
const result = Promise.resolve({
indexPatternTitle,
Expand Down

0 comments on commit 61f2b35

Please sign in to comment.