({ shadowDom }: { shadowDom: boolean })
| 1356 | */ |
| 1357 | export function injectSharedRendererTestsStandalone(ctx: ISharedRendererTestContext, setupCb: () => Promise<void> | void): void { |
| 1358 | const setupTests = ({ shadowDom }: { shadowDom: boolean }): void => { |
| 1359 | test.beforeEach(async () => { |
| 1360 | // Recreate terminal |
| 1361 | await openTerminal(ctx.value, {}, { useShadowDom: shadowDom }); |
| 1362 | await ctx.value.page.evaluate(` |
| 1363 | window.term.options.minimumContrastRatio = 1; |
| 1364 | window.term.options.allowTransparency = false; |
| 1365 | window.term.options.theme = undefined; |
| 1366 | `); |
| 1367 | await setupCb(); |
| 1368 | // Clear the cached screenshot before each test |
| 1369 | frameDetails = undefined; |
| 1370 | }); |
| 1371 | test.describe('regression tests', () => { |
| 1372 | test('#4790: cursor should not be displayed before focusing', async () => { |
| 1373 | const theme: ITheme = { |
| 1374 | cursor: '#0000FF' |
| 1375 | }; |
| 1376 | await ctx.value.page.evaluate(`window.term.options.theme = ${JSON.stringify(theme)};`); |
| 1377 | await pollFor(ctx.value.page, () => getCellColor(ctx.value, 1, 1), [0, 0, 0, 255]); |
| 1378 | await ctx.value.proxy.focus(); |
| 1379 | frameDetails = undefined; |
| 1380 | await pollFor(ctx.value.page, () => getCellColor(ctx.value, 1, 1), [0, 0, 255, 255]); |
| 1381 | await ctx.value.proxy.blur(); |
| 1382 | frameDetails = undefined; |
| 1383 | await pollFor(ctx.value.page, () => getCellColor(ctx.value, 1, 1), [0, 0, 0, 255]); |
| 1384 | }); |
| 1385 | }); |
| 1386 | }; |
| 1387 | |
| 1388 | test.describe('standalone tests', () => { |
| 1389 | setupTests({ shadowDom: false }); |
no test coverage detected