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

Commit a0d70b6

Browse files
committed
Add unit tests. Remove collection binding to model changes, as models are only get
1 parent 83472d5 commit a0d70b6

File tree

3 files changed

+18
-22
lines changed

3 files changed

+18
-22
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ addons:
2222

2323
script:
2424
- npm run lint
25-
#- npm run test
25+
- npm run test
2626
- npm run build
2727
- cd test-e2e/react-app
2828
- npm ci

src/providers.js

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,6 @@ export const behaviorsModel = new Api(`${adminApiPaths.BEHAVIORS}/:name`, {
2828
tags: [TAG]
2929
});
3030

31-
behaviorsModel.onChangeAny(changeDetails => {
32-
if (
33-
[behaviorsModel.actions.delete.success, behaviorsModel.actions.update.success].includes(
34-
changeDetails.action
35-
)
36-
) {
37-
behaviorsCollection.clean();
38-
}
39-
});
40-
4131
export const fixturesCollection = new Api(adminApiPaths.FIXTURES, {
4232
defaultValue: [],
4333
uuid: "fixtures-collection",
@@ -49,13 +39,3 @@ export const fixturesModel = new Api(`${adminApiPaths.FIXTURES}/:id`, {
4939
uuid: "fixtures-model",
5040
tags: [TAG]
5141
});
52-
53-
fixturesModel.onChangeAny(changeDetails => {
54-
if (
55-
[fixturesModel.actions.delete.success, fixturesModel.actions.update.success].includes(
56-
changeDetails.action
57-
)
58-
) {
59-
fixturesCollection.clean();
60-
}
61-
});

test/index.spec.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
1-
import { config } from "../index";
1+
import { config, about, settings, behaviorsCollection, behaviorsModel } from "../index";
22

33
describe("Exported methods", () => {
44
it("should include config", () => {
55
expect(config).toBeDefined();
66
});
7+
8+
it("should include about", () => {
9+
expect(about).toBeDefined();
10+
});
11+
12+
it("should include settings", () => {
13+
expect(settings).toBeDefined();
14+
});
15+
16+
it("should include behaviorsCollection", () => {
17+
expect(behaviorsCollection).toBeDefined();
18+
});
19+
20+
it("should include behaviorsModel", () => {
21+
expect(behaviorsModel).toBeDefined();
22+
});
723
});

0 commit comments

Comments
 (0)