Skip to content

Commit

Permalink
Merge pull request #11455 from keymanapp/chore/web/integration-test-m…
Browse files Browse the repository at this point in the history
…igration

chore(web): conversion of Web's browser-integration auto-tests for @web/test-runner use 🏃
  • Loading branch information
jahorton authored May 23, 2024
2 parents a19d78e + a73bc4a commit feb819e
Show file tree
Hide file tree
Showing 33 changed files with 592 additions and 676 deletions.
26 changes: 0 additions & 26 deletions web/src/test/auto/dom/CI.conf.cjs

This file was deleted.

131 changes: 0 additions & 131 deletions web/src/test/auto/dom/base.conf.cjs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import {
eventOutputTarget,
outputTargetForElement,
PageContextAttachment
} from '/@keymanapp/keyman/build/engine/attachment/lib/index.mjs';
} from 'keyman/engine/attachment';

import { timedPromise } from '/@keymanapp/web-utils/build/lib/index.mjs';
import sinon from '/node_modules/sinon/pkg/sinon-esm.js';
import { timedPromise } from '@keymanapp/web-utils';
import sinon from 'sinon';

import { assert } from '/node_modules/chai/chai.js';
import { assert } from 'chai';

let STANDARD_OPTIONS = {
owner: null,
Expand Down Expand Up @@ -41,12 +41,9 @@ function promiseForIframeLoad(iframe) {
}

describe('outputTargetForElement()', function () {
this.timeout(__karma__.config.args.find((arg) => arg.type == "timeouts").standard);
this.timeout(5000);

before(async function() {
fixture.setBase('fixtures');
fixture.load("a-bit-of-everything.html");

const attacher = this.attacher = new PageContextAttachment(window.document, STANDARD_OPTIONS);

const iframe = document.getElementById('iframe');
Expand All @@ -58,7 +55,6 @@ describe('outputTargetForElement()', function () {
});

after(function() {
fixture.cleanup();
this.attacher?.shutdown();
this.attacher = null;
});
Expand Down Expand Up @@ -143,12 +139,9 @@ describe('outputTargetForElement()', function () {
});

describe('eventOutputTarget()', function () {
this.timeout(__karma__.config.args.find((arg) => arg.type == "timeouts").standard);
this.timeout(5000);

before(async function() {
fixture.setBase('fixtures');
fixture.load("a-bit-of-everything.html");

const attacher = this.attacher = new PageContextAttachment(window.document, STANDARD_OPTIONS);

const iframe = document.getElementById('iframe');
Expand All @@ -159,7 +152,6 @@ describe('eventOutputTarget()', function () {
});

after(function() {
fixture.cleanup();
this.attacher?.shutdown();
this.attacher = null;
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<html>
<head>
<script type="module">
import { runTests } from '@web/test-runner-mocha';

runTests(async() => {
await import('./outputTargetForElement.def.ts');
});
</script>
</head>
<body>
<div>Iframe: <iframe id="iframe" style="height: 100px" src="/resources/html/iframe.html"></iframe>
<div>Design Iframe: <iframe id="design-iframe" style="height: 100px" src="/resources/html/designIframe.html"></iframe>
<div>Content-editable div: <div id="editable" contenteditable="true" style="width: 500px">Edit me!</div></div>
<div>Input: <input id="input"/></div>
<div>Textarea: <textarea id="textarea"></textarea></div>
</body>
</html>
Loading

0 comments on commit feb819e

Please sign in to comment.