Skip to content

Commit

Permalink
Start documentserver example server
Browse files Browse the repository at this point in the history
  • Loading branch information
wginolas committed Aug 12, 2024
1 parent 106043b commit 34eb6db
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions e2etests/test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ describe("test documentserver", function () {
.start();

httpPort = container.getFirstMappedPort();

const { output, exitCode } = await container.exec(["supervisorctl", "start", "ds:example"]);
expect(exitCode).toBe(0);
}, DOCKER_START_TIMEOUT_MS);

afterAll(async () => {
Expand All @@ -34,4 +37,17 @@ describe("test documentserver", function () {
const btn = dom.window.document.querySelector('.button');
expect(btn.firstChild.nodeValue).toBe('GO TO TEST EXAMPLE');
});

it("example page", async function () {
const url = new URL("http://localhost/example/");
url.port = httpPort;
const dom = await JSDOM.fromURL(url, {
runScripts: "dangerously",
pretendToBeVisual: true,
resources: "usable",
});

const link = dom.window.document.querySelector('a.word');
expect(link.firstChild.nodeValue).toBe('Document');
});
});

0 comments on commit 34eb6db

Please sign in to comment.