This repository has been archived by the owner on Dec 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 96
/
dataTypes.spec.ts
52 lines (42 loc) · 1.83 KB
/
dataTypes.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import page from "../../../../../../configs/e2e/src/pages/page";
import ImageViewer from "../objects/imageViewer.widget";
import * as html from "../objects/constants";
describe("Image viewer", () => {
it("loads an image from a dynamic url", () => {
page.open("p/dynamicUrl");
const imageViewer = new ImageViewer("imageViewer1");
imageViewer.element.waitForDisplayed();
const content = imageViewer.imageSrc;
expect(content).toBe(html.dynamicImage);
});
// eslint-disable-next-line jest/no-disabled-tests
xit("loads an image from a dynamic url association", () => {
page.open("p/dynamicUrlAssociation");
const imageViewer = new ImageViewer("imageViewer1");
imageViewer.element.waitForDisplayed();
const content = imageViewer.imageSrc;
expect(content).toBe(html.dynamicImage);
});
// todo: unskip once we figure out why this spec is failing.
// eslint-disable-next-line jest/no-disabled-tests
xit("loads no image when no image url is specified", () => {
page.open("p/emptyUrl");
const imageViewer = new ImageViewer("imageViewer1");
const content = imageViewer.imageSrcHidden;
expect(content).toContain(page.url);
});
it("loads an image from a static image", () => {
page.open("p/staticImage");
const imageViewer = new ImageViewer("imageViewer1");
imageViewer.element.waitForDisplayed();
const content = imageViewer.imageSrc;
expect(content).toContain(html.staticImage);
});
it("loads an image from a static URL", () => {
page.open("p/staticUrl");
const imageViewer = new ImageViewer("imageViewer1");
imageViewer.element.waitForDisplayed();
const content = imageViewer.imageSrc;
expect(content).toBe(html.staticUrl);
});
});