diff --git a/__tests__/__image_snapshots__/html/copy-button-js-copy-button-should-work-1-snap.png b/__tests__/__image_snapshots__/html/copy-button-js-copy-button-should-work-1-snap.png deleted file mode 100644 index 572ed48e3c..0000000000 Binary files a/__tests__/__image_snapshots__/html/copy-button-js-copy-button-should-work-1-snap.png and /dev/null differ diff --git a/__tests__/__image_snapshots__/html/copy-button-js-copy-button-should-work-2-snap.png b/__tests__/__image_snapshots__/html/copy-button-js-copy-button-should-work-2-snap.png deleted file mode 100644 index f535c49191..0000000000 Binary files a/__tests__/__image_snapshots__/html/copy-button-js-copy-button-should-work-2-snap.png and /dev/null differ diff --git a/__tests__/__image_snapshots__/html/copy-button-js-copy-button-should-work-3-snap.png b/__tests__/__image_snapshots__/html/copy-button-js-copy-button-should-work-3-snap.png deleted file mode 100644 index b9eb49a501..0000000000 Binary files a/__tests__/__image_snapshots__/html/copy-button-js-copy-button-should-work-3-snap.png and /dev/null differ diff --git a/__tests__/html/copyButton.denied.js b/__tests__/html/copyButton.denied.js deleted file mode 100644 index e62a0ae418..0000000000 --- a/__tests__/html/copyButton.denied.js +++ /dev/null @@ -1,3 +0,0 @@ -/** @jest-environment ./packages/test/harness/src/host/jest/WebDriverEnvironment.js */ - -test('copy button with denied permission should be disabled', () => runHTML('copyButton.denied')); diff --git a/__tests__/html/copyButton.disabled.js b/__tests__/html/copyButton.disabled.js deleted file mode 100644 index 4381b312c1..0000000000 --- a/__tests__/html/copyButton.disabled.js +++ /dev/null @@ -1,3 +0,0 @@ -/** @jest-environment ./packages/test/harness/src/host/jest/WebDriverEnvironment.js */ - -test('copy button should be able to disable', () => runHTML('copyButton.disabled')); diff --git a/__tests__/html/copyButton.hideAndShow.js b/__tests__/html/copyButton.hideAndShow.js deleted file mode 100644 index dfdde9572d..0000000000 --- a/__tests__/html/copyButton.hideAndShow.js +++ /dev/null @@ -1,3 +0,0 @@ -/** @jest-environment ./packages/test/harness/src/host/jest/WebDriverEnvironment.js */ - -test('copy button should not show as copied on hide/show', () => runHTML('copyButton.hideAndShow')); diff --git a/__tests__/html/copyButton.js b/__tests__/html/copyButton.js deleted file mode 100644 index b0e1a879eb..0000000000 --- a/__tests__/html/copyButton.js +++ /dev/null @@ -1,3 +0,0 @@ -/** @jest-environment ./packages/test/harness/src/host/jest/WebDriverEnvironment.js */ - -test('copy button should work', () => runHTML('copyButton')); diff --git a/__tests__/html/copyButton.layout.js b/__tests__/html/copyButton.layout.js deleted file mode 100644 index bdf462a54e..0000000000 --- a/__tests__/html/copyButton.layout.js +++ /dev/null @@ -1,12 +0,0 @@ -/** @jest-environment ./packages/test/harness/src/host/jest/WebDriverEnvironment.js */ - -describe.each([ - ['light', 'white label'], - ['dark', 'fluent'], - ['dark', 'copilot'], - ['light', 'fluent'], - ['light', 'copilot'] -])('with %s theme and %s variant', (theme, variant) => - test('copy button should layout properly', () => - runHTML(`copyButton.layout?${new URLSearchParams({ theme, variant }).toString()}`)) -); diff --git a/__tests__/html/copyButton.denied.html b/__tests__/html2/copyButton/behavior.denied.html similarity index 97% rename from __tests__/html/copyButton.denied.html rename to __tests__/html2/copyButton/behavior.denied.html index 770a09c9cb..946dd70f2f 100644 --- a/__tests__/html/copyButton.denied.html +++ b/__tests__/html2/copyButton/behavior.denied.html @@ -59,13 +59,13 @@ expect(copyButton.getAttribute('aria-disabled')).toBe('true'); // THEN: Should match screenshot. - await host.snapshot(); + await host.snapshot('local'); // WHEN: Clicks the "Copy" button. await host.click(copyButton); // THEN: The copy button should not change to "Copied". - await host.snapshot(); + await host.snapshot('local'); });
diff --git a/__tests__/__image_snapshots__/html/copy-button-denied-js-copy-button-with-denied-permission-should-be-disabled-1-snap.png b/__tests__/html2/copyButton/behavior.denied.html.snap-1.png similarity index 100% rename from __tests__/__image_snapshots__/html/copy-button-denied-js-copy-button-with-denied-permission-should-be-disabled-1-snap.png rename to __tests__/html2/copyButton/behavior.denied.html.snap-1.png diff --git a/__tests__/__image_snapshots__/html/copy-button-denied-js-copy-button-with-denied-permission-should-be-disabled-2-snap.png b/__tests__/html2/copyButton/behavior.denied.html.snap-2.png similarity index 100% rename from __tests__/__image_snapshots__/html/copy-button-denied-js-copy-button-with-denied-permission-should-be-disabled-2-snap.png rename to __tests__/html2/copyButton/behavior.denied.html.snap-2.png diff --git a/__tests__/html/copyButton.disabled.html b/__tests__/html2/copyButton/behavior.disabled.html similarity index 97% rename from __tests__/html/copyButton.disabled.html rename to __tests__/html2/copyButton/behavior.disabled.html index 1956fbdb82..4ef5e95b74 100644 --- a/__tests__/html/copyButton.disabled.html +++ b/__tests__/html2/copyButton/behavior.disabled.html @@ -59,13 +59,13 @@ expect(copyButton.getAttribute('aria-disabled')).toBe('true'); // THEN: Should match screenshot. - await host.snapshot(); + await host.snapshot('local'); // WHEN: Clicks the "Copy" button. await host.click(copyButton); // THEN: The copy button should not change to "Copied". - await host.snapshot(); + await host.snapshot('local'); }); diff --git a/__tests__/__image_snapshots__/html/copy-button-disabled-js-copy-button-should-be-able-to-disable-1-snap.png b/__tests__/html2/copyButton/behavior.disabled.html.snap-1.png similarity index 100% rename from __tests__/__image_snapshots__/html/copy-button-disabled-js-copy-button-should-be-able-to-disable-1-snap.png rename to __tests__/html2/copyButton/behavior.disabled.html.snap-1.png diff --git a/__tests__/__image_snapshots__/html/copy-button-disabled-js-copy-button-should-be-able-to-disable-2-snap.png b/__tests__/html2/copyButton/behavior.disabled.html.snap-2.png similarity index 100% rename from __tests__/__image_snapshots__/html/copy-button-disabled-js-copy-button-should-be-able-to-disable-2-snap.png rename to __tests__/html2/copyButton/behavior.disabled.html.snap-2.png diff --git a/__tests__/html/copyButton.hideAndShow.html b/__tests__/html2/copyButton/behavior.hideAndShow.html similarity index 96% rename from __tests__/html/copyButton.hideAndShow.html rename to __tests__/html2/copyButton/behavior.hideAndShow.html index f66d3623f5..e23d33596c 100644 --- a/__tests__/html/copyButton.hideAndShow.html +++ b/__tests__/html2/copyButton/behavior.hideAndShow.html @@ -63,13 +63,13 @@ await host.click(document.querySelector(`[data-testid="${WebChat.testIds.copyButton}"]`)); // THEN: The "Copy" button should say "Copied". - await host.snapshot(); + await host.snapshot('local'); // WHEN: After 1 second. await testHelpers.sleep(1_000); // THEN: The "Copy" button should back to normal. - await host.snapshot(); + await host.snapshot('local'); // WHEN: Hiding Web Chat and showing it back. document.getElementById('webchat').style.display = 'none'; @@ -77,7 +77,7 @@ document.getElementById('webchat').style.display = ''; // THEN: The "Copy" button should kept at normal. - await host.snapshot(); + await host.snapshot('local'); }); diff --git a/__tests__/__image_snapshots__/html/copy-button-hide-and-show-js-copy-button-should-not-show-as-copied-on-hide-show-1-snap.png b/__tests__/html2/copyButton/behavior.hideAndShow.html.snap-1.png similarity index 100% rename from __tests__/__image_snapshots__/html/copy-button-hide-and-show-js-copy-button-should-not-show-as-copied-on-hide-show-1-snap.png rename to __tests__/html2/copyButton/behavior.hideAndShow.html.snap-1.png diff --git a/__tests__/__image_snapshots__/html/copy-button-hide-and-show-js-copy-button-should-not-show-as-copied-on-hide-show-2-snap.png b/__tests__/html2/copyButton/behavior.hideAndShow.html.snap-2.png similarity index 100% rename from __tests__/__image_snapshots__/html/copy-button-hide-and-show-js-copy-button-should-not-show-as-copied-on-hide-show-2-snap.png rename to __tests__/html2/copyButton/behavior.hideAndShow.html.snap-2.png diff --git a/__tests__/__image_snapshots__/html/copy-button-hide-and-show-js-copy-button-should-not-show-as-copied-on-hide-show-3-snap.png b/__tests__/html2/copyButton/behavior.hideAndShow.html.snap-3.png similarity index 100% rename from __tests__/__image_snapshots__/html/copy-button-hide-and-show-js-copy-button-should-not-show-as-copied-on-hide-show-3-snap.png rename to __tests__/html2/copyButton/behavior.hideAndShow.html.snap-3.png diff --git a/__tests__/html/copyButton.html b/__tests__/html2/copyButton/behavior.html similarity index 84% rename from __tests__/html/copyButton.html rename to __tests__/html2/copyButton/behavior.html index 14edc9db93..d75ef9e43d 100644 --- a/__tests__/html/copyButton.html +++ b/__tests__/html2/copyButton/behavior.html @@ -73,7 +73,7 @@ type: 'https://schema.org/Message' } ], - text: 'Mollit *aute* **aute** dolor ea ex magna incididunt nostrud sit nisi.', + text: 'Mollit *aute* **aute** dolor ea ex magna incididunt nostrud sit nisi. ![Icon](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAUCAYAAABiS3YzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFvSURBVHgB7ZPdcYJAFIUX9D2UgBWIFQS0AUsgFYQOhA7sILGCkAIUUkGwA0og7/zku8mSWYHM+OKbd8bhsufcc84uq1L3unn5vu+u1+u3K7lSu+G6PVywLCtr2/asrqsC/hbh6EJj4Bzatv14Op2eSLvrum6VZdlWjRO6Yg4e8OowI0EWeZ5Xo6QQnwEPMsRryFA0FY/hEu47vxd6SVsgHKrh9hFyAF1IOYTodzYvDdzTZj+FeQxf1hzMDywtR6Lz+dwDPOvES0k8OJZP2bKRtoIvph5YSb8YidZ1XQE+6BRfs9nM6TH6Spsps+BXaqLMMxU3Vw8XTdN4PXA8HlMEAsxW5jB84RQEkrk/gwvrzWaTIZaIgWxXRMxzNUtuBw9XbkoQBClBUvrXYVJx/gDcaaGEfj8lKB+NR4hpoq/XshcciQLEPBz5l9DvMYmnROUa6aOo9MdLTNyaSOGy9ZQhv7/M/xVHEMFz4MXqXjetb0P8xVy6y7nkAAAAAElFTkSuQmCC)', type: 'message' }); @@ -88,13 +88,13 @@ const copyButton = document.querySelector(`[data-testid="${WebChat.testIds.copyButton}"]`); expect(document.activeElement).toBe(copyButton); - await host.snapshot(); + await host.snapshot('local'); // WHEN: Press ENTER on the "Copy" button. await host.sendKeys('ENTER'); // THEN: The copy button should change to "Copied". - await host.snapshot(); + await host.snapshot('local'); // WHEN: Paste into plain text and rich text text box. await host.click(document.querySelector('[data-testid="plain-text-box"]')); @@ -109,7 +109,7 @@ await testHelpers.sleep(500); // THEN: Plain text box should contains plain text, while rich text box should contains rich text. - await host.snapshot(); + await host.snapshot('local'); }); diff --git a/__tests__/html2/copyButton/behavior.html.snap-1.png b/__tests__/html2/copyButton/behavior.html.snap-1.png new file mode 100644 index 0000000000..90cacf6298 Binary files /dev/null and b/__tests__/html2/copyButton/behavior.html.snap-1.png differ diff --git a/__tests__/html2/copyButton/behavior.html.snap-2.png b/__tests__/html2/copyButton/behavior.html.snap-2.png new file mode 100644 index 0000000000..07e6a7c7cf Binary files /dev/null and b/__tests__/html2/copyButton/behavior.html.snap-2.png differ diff --git a/__tests__/html2/copyButton/behavior.html.snap-3.png b/__tests__/html2/copyButton/behavior.html.snap-3.png new file mode 100644 index 0000000000..d6e1c2174c Binary files /dev/null and b/__tests__/html2/copyButton/behavior.html.snap-3.png differ diff --git a/__tests__/html2/copyButton/layout.copilot.dark.html b/__tests__/html2/copyButton/layout.copilot.dark.html new file mode 100644 index 0000000000..ec7f21581e --- /dev/null +++ b/__tests__/html2/copyButton/layout.copilot.dark.html @@ -0,0 +1,9 @@ + + +
+ + +
+