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

32 lines
924 B
TypeScript
Raw Normal View History

import { openTest, injectRuffleAndWait, playAndMonitor } from "../../utils.js";
import { expect, use } from "chai";
import chaiHtml from "chai-html";
import fs from "fs";
2020-07-14 14:15:55 +00:00
use(chaiHtml);
describe("Object with only data attribute", () => {
it("loads the test", async () => {
await openTest(browser, `polyfill/object_data`);
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);
const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`,
"utf8",
);
2020-07-14 14:15:55 +00:00
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-object />"),
);
});
2020-07-14 14:15:55 +00:00
});