mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-20 02:56:10 +00:00
test(plugins): avoid a non-null assertion in the new frame visibility tests
The added test used querySelector('iframe')! which pushes the tests
no-non-null-assertion count one over its frozen baseline; cast instead.
This commit is contained in:
@@ -975,7 +975,7 @@ describe('PluginFrame visibility and mobile suspend', () => {
|
||||
|
||||
it('FE-PLUGINS-FRAME-062: tells the plugin when it leaves the screen', () => {
|
||||
const { container } = render(<PluginFrame pluginId="demo" surface="dashboard-widget" />);
|
||||
const iframe = container.querySelector('iframe')!;
|
||||
const iframe = container.querySelector('iframe') as HTMLIFrameElement;
|
||||
const posted: Array<Record<string, unknown>> = [];
|
||||
(iframe.contentWindow as unknown as { postMessage: (m: unknown) => void }).postMessage = (m) => posted.push(m as Record<string, unknown>);
|
||||
fire(false);
|
||||
|
||||
Reference in New Issue
Block a user