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

33 lines
895 B
JavaScript
Raw Normal View History

const {
2023-05-30 20:24:43 +00:00
openTest,
injectRuffleAndWait,
playAndMonitor,
} = require("../../utils");
2020-07-14 14:15:55 +00:00
const { expect, use } = require("chai");
const chaiHtml = require("chai-html");
const fs = require("fs");
use(chaiHtml);
describe("Object with only data attribute", () => {
it("loads the test", async () => {
2023-05-30 20:24:43 +00:00
await openTest(browser, __dirname);
2020-07-14 14:15:55 +00:00
});
it("Polyfills", async () => {
2023-05-30 20:24:43 +00:00
await injectRuffleAndWait(browser);
await browser.$("<ruffle-object />").waitForExist();
2020-07-14 14:15:55 +00:00
const actual = await browser.$("#test-container").getHTML(false);
2020-07-14 14:15:55 +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,
await browser.$("#test-container").$("<ruffle-object />")
);
});
2020-07-14 14:15:55 +00:00
});