-
Notifications
You must be signed in to change notification settings - Fork 29
/
main.spec.js
34 lines (32 loc) · 1.13 KB
/
main.spec.js
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
import Vue from "vue";
import App from "./components/App.js";
describe("Vue component tests", () => {
it("An example test should pass.", () => {
expect(2).toEqual(2);
});
it("The component should have a title property.", () => {
const defaultData = App.data();
// expect(defaultData.title).toBe("BT3103 Week 10");
});
it("The component should have an updateCurrentChart function.", () => {
expect(typeof App.methods.updateCurrentChart).toBe("function");
});
it("has a created hook", () => {
expect(typeof App).toBe("object");
});
it("The component should have a data function.", () => {
expect(typeof App.data).toBe("function");
const defaultData = App.data();
// And there should be localCharts.
expect(typeof defaultData).toBe("object");
});
it("There should be local chart data.", () => {
const defaultData = App.data();
expect(defaultData.localLineData.length).toBe(3);
expect(defaultData.localBarData.length).toBe(6);
});
it("Current chart should be localBarData.", () => {
const defaultData = App.data();
expect(defaultData.currentChart).toBe("localBarData");
});
});