test(toast): toHaveScreenshot signature is correct (#26812)

This commit is contained in:
Liam DeBeasi
2023-02-16 13:48:54 -05:00
committed by GitHub
parent fef634f7f0
commit eaf088c3a2

View File

@@ -36,8 +36,13 @@ class ToastFixture {
async screenshot(screenshotModifier: string, el?: Locator) {
const { page } = this;
const reference = el !== undefined ? el : page;
await expect(reference).toHaveScreenshot(`toast-${screenshotModifier}-${page.getSnapshotSettings()}.png`);
const screenshotString = `toast-${screenshotModifier}-${page.getSnapshotSettings()}.png`;
if (el === undefined) {
await expect(page).toHaveScreenshot(screenshotString);
} else {
await expect(el).toHaveScreenshot(screenshotString);
}
}
skipRTL(testRef: typeof test, reason = 'This functionality does not have RTL-specific behaviors.') {
@@ -151,7 +156,7 @@ test.describe('toast: duration config', () => {
<ion-toast></ion-toast>
<script>
window.Ionic = {
config: { toastDuration: 5000 }
config: { toastDuration: 5000 }
}
</script>
`);