-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
40b2748
commit 36de096
Showing
17 changed files
with
105 additions
and
26 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,42 @@ | ||
import { fixture, nextFrame } from '@open-wc/testing'; | ||
import { flush } from '@polymer/polymer/lib/utils/flush'; | ||
import { fixture } from '@open-wc/testing'; | ||
import { perform } from '@neovici/cfg/web/perform.js'; | ||
|
||
export const setupOmnitableFixture = async (omnitableFixture, data) => { | ||
const omnitable = await fixture(omnitableFixture); | ||
|
||
await perform(async ({ page, expect }) => { | ||
await expect(page.locator('cosmoz-omnitable-header-row')).toBeVisible(); | ||
}); | ||
|
||
omnitable.data = data; | ||
await nextFrame(); | ||
flush(); | ||
await nextFrame(); | ||
return omnitable; | ||
}; | ||
|
||
export const rowVisible = async () => { | ||
await perform(async ({ page, expect }) => { | ||
await expect(page.locator('.itemRow').first()).toBeVisible(); | ||
}); | ||
}; | ||
|
||
export const ignoreResizeObserverLoopErrors = (setup, teardown) => { | ||
// called before any tests are run | ||
const e = window.onerror; | ||
|
||
setup(() => { | ||
window.onerror = function (err) { | ||
if ( | ||
err === 'ResizeObserver loop limit exceeded' || | ||
err === 'ResizeObserver loop completed with undelivered notifications.' | ||
) { | ||
// eslint-disable-next-line no-console | ||
console.warn('Ignored:', err); | ||
return false; | ||
} | ||
return e(...arguments); | ||
}; | ||
}); | ||
|
||
teardown(() => { | ||
window.onerror = e; | ||
}); | ||
}; |
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
Oops, something went wrong.