ruffle/web/packages/selfhosted/test/polyfill/embed_default/test.js

31 lines
823 B
JavaScript
Raw Normal View History

const {
2023-05-30 20:24:43 +00:00
injectRuffleAndWait,
openTest,
playAndMonitor,
} = require("../../utils");
2020-05-23 09:43:22 +00:00
const { expect, use } = require("chai");
const chaiHtml = require("chai-html");
const fs = require("fs");
use(chaiHtml);
2020-09-05 18:36:44 +00:00
describe("Embed tag", () => {
it("loads the test", async () => {
2023-05-30 20:24:43 +00:00
await openTest(browser, __dirname);
2020-05-23 09:43:22 +00:00
});
it("polyfills with ruffle", async () => {
2023-05-30 20:24:43 +00:00
await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false);
2020-05-23 09:43:22 +00:00
const expected = fs.readFileSync(`${__dirname}/expected.html`, "utf8");
expect(actual).html.to.equal(expected);
});
it("Plays a movie", async () => {
2023-05-30 20:24:43 +00:00
await playAndMonitor(
browser,
2023-07-20 11:19:39 +00:00
await browser.$("#test-container").$("<ruffle-embed />"),
);
});
2020-05-23 09:43:22 +00:00
});