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

31 lines
823 B
JavaScript

const {
injectRuffleAndWait,
openTest,
playAndMonitor,
} = require("../../utils");
const { expect, use } = require("chai");
const chaiHtml = require("chai-html");
const fs = require("fs");
use(chaiHtml);
describe("Embed tag", () => {
it("loads the test", async () => {
await openTest(browser, __dirname);
});
it("polyfills with ruffle", async () => {
await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false);
const expected = fs.readFileSync(`${__dirname}/expected.html`, "utf8");
expect(actual).html.to.equal(expected);
});
it("Plays a movie", async () => {
await playAndMonitor(
browser,
await browser.$("#test-container").$("<ruffle-embed />"),
);
});
});