mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-12 10:39:57 +00:00
chrome.cast class tests
This commit is contained in:
40
test/spec/shim/cast/Image.spec.js
Normal file
40
test/spec/shim/cast/Image.spec.js
Normal file
@@ -0,0 +1,40 @@
|
||||
"use strict";
|
||||
|
||||
const { create } = require("../../../driver");
|
||||
|
||||
describe("chrome.cast.Image", () => {
|
||||
let driver;
|
||||
|
||||
beforeAll(async () => {
|
||||
driver = await create();
|
||||
});
|
||||
afterAll(() => {
|
||||
driver.quit();
|
||||
})
|
||||
|
||||
|
||||
it("should have all properties", async () => {
|
||||
const [ typeof_url
|
||||
, image ] = await driver.executeScript(() => {
|
||||
|
||||
const image = new chrome.cast.Image();
|
||||
|
||||
return [
|
||||
typeof image.url
|
||||
, image
|
||||
];
|
||||
});
|
||||
|
||||
expect(typeof_url).toBe("undefined");
|
||||
expect(image.height).toBe(null);
|
||||
expect(image.width).toBe(null);
|
||||
});
|
||||
|
||||
it("should have expected assigned properties", async () => {
|
||||
const image = await driver.executeScript(() => {
|
||||
return new chrome.cast.Image("http://example.com");
|
||||
});
|
||||
|
||||
expect(image.url).toBe("http://example.com");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user