intechstudio / grid-editor

GNU General Public License v3.0
33 stars 3 forks source link

Added navigator mock before tests to allow tests in headless mode #785

Closed kkerti closed 1 month ago

kkerti commented 1 month ago

Use this before the tests:

test.beforeEach(({ page }) => {
  // mocks navigator.serial, so headless UI tests can run!
  page.addInitScript(
    "Object.defineProperty(navigator,'serial',{set: () => undefined, get: () => undefined})"
  );
});
github-actions[bot] commented 1 month ago

Visit the preview URL for this PR (updated for commit cb29f46):

https://grid-editor-web--pr785-kk-test-chrome-navig-gr4ehglb.web.app

(expires Tue, 30 Jul 2024 08:09:54 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 2b65ba6ef19c55d367eaffd04e46bcde25305d6f