Skip to content
This repository was archived by the owner on Mar 28, 2022. It is now read-only.

Commit e406458

Browse files
committed
Add unit tests
1 parent c28502b commit e406458

File tree

2 files changed

+44
-6
lines changed

2 files changed

+44
-6
lines changed

test/index.spec.js

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
import { config, about, settings, behaviorsCollection, behaviorsModel } from "../index";
1+
import {
2+
config,
3+
about,
4+
settings,
5+
behaviors,
6+
behavior,
7+
behaviorsModel,
8+
fixtures,
9+
fixture,
10+
fixturesModel
11+
} from "../index";
212

313
describe("Exported methods", () => {
414
it("should include config", () => {
@@ -13,11 +23,27 @@ describe("Exported methods", () => {
1323
expect(settings).toBeDefined();
1424
});
1525

16-
it("should include behaviorsCollection", () => {
17-
expect(behaviorsCollection).toBeDefined();
26+
it("should include behaviors", () => {
27+
expect(behaviors).toBeDefined();
28+
});
29+
30+
it("should include behavior", () => {
31+
expect(behavior).toBeDefined();
1832
});
1933

2034
it("should include behaviorsModel", () => {
2135
expect(behaviorsModel).toBeDefined();
2236
});
37+
38+
it("should include fixtures", () => {
39+
expect(fixtures).toBeDefined();
40+
});
41+
42+
it("should include fixture", () => {
43+
expect(fixture).toBeDefined();
44+
});
45+
46+
it("should include fixturesModel", () => {
47+
expect(fixturesModel).toBeDefined();
48+
});
2349
});

test/src/providers.spec.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,33 @@
1-
import { behaviorsModel, fixturesModel } from "../../src/providers";
1+
import { behaviorsModel, behavior, fixturesModel, fixture } from "../../src/providers";
22

33
describe("behaviorsModel findByName custom query", () => {
44
it("should return name urlParam", () => {
5-
expect(behaviorsModel.test.customQueries.findByName("foo")).toEqual({
5+
expect(behaviorsModel.test.customQueries.byName("foo")).toEqual({
66
urlParams: {
77
name: "foo"
88
}
99
});
1010
});
1111
});
1212

13+
describe("behavior alias", () => {
14+
it("should return queried behaviorsModel", () => {
15+
expect(behavior("foo")).toEqual(behaviorsModel.byName("foo"));
16+
});
17+
});
18+
1319
describe("fixturesModel findById custom query", () => {
1420
it("should return name urlParam", () => {
15-
expect(fixturesModel.test.customQueries.findById("foo")).toEqual({
21+
expect(fixturesModel.test.customQueries.byId("foo")).toEqual({
1622
urlParams: {
1723
id: "foo"
1824
}
1925
});
2026
});
2127
});
28+
29+
describe("fixture alias", () => {
30+
it("should return queried fixturesModel", () => {
31+
expect(fixture("foo")).toEqual(fixturesModel.byId("foo"));
32+
});
33+
});

0 commit comments

Comments
 (0)