This repository has been archived by the owner on Jul 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
28bca29
commit f37d26d
Showing
2 changed files
with
381 additions
and
0 deletions.
There are no files selected for viewing
306 changes: 306 additions & 0 deletions
306
imports/store/nav/__tests__/__snapshots__/reducer.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,306 @@ | ||
exports[`test NAV.ANYTHING_ELSE 1`] = ` | ||
Object { | ||
"bgColor": "#202020", | ||
"fgColor": "dark", | ||
"level": "TOP", | ||
"links": Array [ | ||
Object { | ||
"icon": "icon-logo", | ||
"id": 1, | ||
"isActive": [Function], | ||
"label": "Home", | ||
"link": "/", | ||
}, | ||
Object { | ||
"action": [Function], | ||
"icon": "icon-sections", | ||
"id": 2, | ||
"isActive": [Function], | ||
"label": "Sections", | ||
}, | ||
Object { | ||
"icon": "icon-groups", | ||
"id": 3, | ||
"isActive": [Function], | ||
"label": "Groups", | ||
"link": "/groups/finder", | ||
}, | ||
Object { | ||
"action": [Function], | ||
"icon": "icon-search", | ||
"id": 4, | ||
"isActive": [Function], | ||
"label": "Discover", | ||
}, | ||
Object { | ||
"icon": "icon-profile", | ||
"id": 5, | ||
"isActive": [Function], | ||
"label": "Profile", | ||
"link": "/profile/settings", | ||
}, | ||
], | ||
"visible": true, | ||
} | ||
`; | ||
|
||
exports[`test NAV.RESET_COLOR 1`] = ` | ||
Object { | ||
"bgColor": "#202020", | ||
"fgColor": "dark", | ||
"level": "TOP", | ||
"links": Array [ | ||
Object { | ||
"icon": "icon-logo", | ||
"id": 1, | ||
"isActive": [Function], | ||
"label": "Home", | ||
"link": "/", | ||
}, | ||
Object { | ||
"action": [Function], | ||
"icon": "icon-sections", | ||
"id": 2, | ||
"isActive": [Function], | ||
"label": "Sections", | ||
}, | ||
Object { | ||
"icon": "icon-groups", | ||
"id": 3, | ||
"isActive": [Function], | ||
"label": "Groups", | ||
"link": "/groups/finder", | ||
}, | ||
Object { | ||
"action": [Function], | ||
"icon": "icon-search", | ||
"id": 4, | ||
"isActive": [Function], | ||
"label": "Discover", | ||
}, | ||
Object { | ||
"icon": "icon-profile", | ||
"id": 5, | ||
"isActive": [Function], | ||
"label": "Profile", | ||
"link": "/profile/settings", | ||
}, | ||
], | ||
"visible": true, | ||
} | ||
`; | ||
|
||
exports[`test NAV.SET_ACTION 1`] = ` | ||
Object { | ||
"bgColor": "#202020", | ||
"fgColor": "dark", | ||
"level": "TOP", | ||
"links": Array [ | ||
Object { | ||
"action": "test", | ||
"icon": "icon-logo", | ||
"id": 1, | ||
"isActive": [Function], | ||
"label": "Home", | ||
"link": "/", | ||
}, | ||
Object { | ||
"action": [Function], | ||
"icon": "icon-sections", | ||
"id": 2, | ||
"isActive": [Function], | ||
"label": "Sections", | ||
}, | ||
Object { | ||
"icon": "icon-groups", | ||
"id": 3, | ||
"isActive": [Function], | ||
"label": "Groups", | ||
"link": "/groups/finder", | ||
}, | ||
Object { | ||
"action": [Function], | ||
"icon": "icon-search", | ||
"id": 4, | ||
"isActive": [Function], | ||
"label": "Discover", | ||
}, | ||
Object { | ||
"icon": "icon-profile", | ||
"id": 5, | ||
"isActive": [Function], | ||
"label": "Profile", | ||
"link": "/profile/settings", | ||
}, | ||
], | ||
"visible": true, | ||
} | ||
`; | ||
|
||
exports[`test NAV.SET_COLOR 1`] = ` | ||
Object { | ||
"bgColor": "orange", | ||
"fgColor": "purple", | ||
"level": "TOP", | ||
"links": Array [ | ||
Object { | ||
"icon": "icon-logo", | ||
"id": 1, | ||
"isActive": [Function], | ||
"label": "Home", | ||
"link": "/", | ||
}, | ||
Object { | ||
"action": [Function], | ||
"icon": "icon-sections", | ||
"id": 2, | ||
"isActive": [Function], | ||
"label": "Sections", | ||
}, | ||
Object { | ||
"icon": "icon-groups", | ||
"id": 3, | ||
"isActive": [Function], | ||
"label": "Groups", | ||
"link": "/groups/finder", | ||
}, | ||
Object { | ||
"action": [Function], | ||
"icon": "icon-search", | ||
"id": 4, | ||
"isActive": [Function], | ||
"label": "Discover", | ||
}, | ||
Object { | ||
"icon": "icon-profile", | ||
"id": 5, | ||
"isActive": [Function], | ||
"label": "Profile", | ||
"link": "/profile/settings", | ||
}, | ||
], | ||
"visible": true, | ||
} | ||
`; | ||
|
||
exports[`test NAV.SET_LEVEL 1`] = ` | ||
Object { | ||
"bgColor": "red", | ||
"fgColor": "blue", | ||
"level": "CONTENT", | ||
"links": Array [ | ||
Object { | ||
"action": [Function], | ||
"icon": "icon-arrow-back", | ||
"id": 1, | ||
}, | ||
Object { | ||
"action": false, | ||
"activeIcon": "icon-like-solid", | ||
"icon": "icon-like", | ||
"id": 2, | ||
"isActive": [Function], | ||
}, | ||
Object { | ||
"action": [Function], | ||
"icon": "icon-share", | ||
"id": 3, | ||
}, | ||
], | ||
"visible": true, | ||
} | ||
`; | ||
|
||
exports[`test NAV.SET_LINKS 1`] = ` | ||
Object { | ||
"bgColor": "#202020", | ||
"fgColor": "dark", | ||
"level": "TOP", | ||
"links": Array [ | ||
Object { | ||
"icon": "icon-logo", | ||
"id": 1, | ||
"isActive": [Function], | ||
"label": "Home", | ||
"link": "/", | ||
}, | ||
Object { | ||
"action": [Function], | ||
"icon": "icon-sections", | ||
"id": 2, | ||
"isActive": [Function], | ||
"label": "Sections", | ||
}, | ||
Object { | ||
"icon": "icon-groups", | ||
"id": 3, | ||
"isActive": [Function], | ||
"label": "Groups", | ||
"link": "/groups/finder", | ||
}, | ||
Object { | ||
"action": [Function], | ||
"icon": "icon-search", | ||
"id": 4, | ||
"isActive": [Function], | ||
"label": "Discover", | ||
}, | ||
Object { | ||
"icon": "icon-profile", | ||
"id": 5, | ||
"isActive": [Function], | ||
"label": "Profile", | ||
"link": "/profile/settings", | ||
}, | ||
"one", | ||
"two", | ||
], | ||
"visible": true, | ||
} | ||
`; | ||
|
||
exports[`test NAV.SET_VISIBILITY 1`] = ` | ||
Object { | ||
"bgColor": "#202020", | ||
"fgColor": "dark", | ||
"level": "TOP", | ||
"links": Array [ | ||
Object { | ||
"icon": "icon-logo", | ||
"id": 1, | ||
"isActive": [Function], | ||
"label": "Home", | ||
"link": "/", | ||
}, | ||
Object { | ||
"action": [Function], | ||
"icon": "icon-sections", | ||
"id": 2, | ||
"isActive": [Function], | ||
"label": "Sections", | ||
}, | ||
Object { | ||
"icon": "icon-groups", | ||
"id": 3, | ||
"isActive": [Function], | ||
"label": "Groups", | ||
"link": "/groups/finder", | ||
}, | ||
Object { | ||
"action": [Function], | ||
"icon": "icon-search", | ||
"id": 4, | ||
"isActive": [Function], | ||
"label": "Discover", | ||
}, | ||
Object { | ||
"icon": "icon-profile", | ||
"id": 5, | ||
"isActive": [Function], | ||
"label": "Profile", | ||
"link": "/profile/settings", | ||
}, | ||
], | ||
"visible": false, | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import reducer from "../reducer"; | ||
|
||
it("NAV.SET_LEVEL", () => { | ||
const action = { | ||
type: "NAV.SET_LEVEL", | ||
level: "CONTENT", | ||
bgColor: "red", | ||
fgColor: "blue", | ||
}; | ||
const result = reducer(undefined, action); | ||
expect(result).toMatchSnapshot(); | ||
}); | ||
|
||
it("NAV.SET_LINKS", () => { | ||
const action = { | ||
type: "NAV.SET_LINKS", | ||
links: ["one", "two"], | ||
}; | ||
const result = reducer(undefined, action); | ||
expect(result).toMatchSnapshot(); | ||
}); | ||
|
||
it("NAV.SET_COLOR", () => { | ||
const action = { | ||
type: "NAV.SET_COLOR", | ||
bgColor: "orange", | ||
fgColor: "purple", | ||
}; | ||
const result = reducer(undefined, action); | ||
expect(result).toMatchSnapshot(); | ||
}); | ||
|
||
it("NAV.RESET_COLOR", () => { | ||
const action = { | ||
type: "NAV.SET_COLOR", | ||
bgColor: "orange", | ||
fgColor: "purple", | ||
}; | ||
reducer(undefined, action); | ||
const action2 = { | ||
type: "NAV.RESET_COLOR", | ||
}; | ||
const result = reducer(undefined, action2); | ||
expect(result).toMatchSnapshot(); | ||
}); | ||
|
||
it("NAV.SET_ACTION", () => { | ||
const action = { | ||
type: "NAV.SET_ACTION", | ||
level: "TOP", | ||
props: { | ||
id: 1, | ||
action: "test", | ||
}, | ||
}; | ||
const result = reducer(undefined, action); | ||
expect(result).toMatchSnapshot(); | ||
}); | ||
|
||
it("NAV.SET_VISIBILITY", () => { | ||
const action = { | ||
type: "NAV.SET_VISIBILITY", | ||
visible: false, | ||
}; | ||
const result = reducer(undefined, action); | ||
expect(result).toMatchSnapshot(); | ||
}); | ||
|
||
it("NAV.ANYTHING_ELSE",() => { | ||
const action = { | ||
type: "NAV.ANYTHING_ELSE", | ||
}; | ||
const result = reducer(undefined, action); | ||
expect(result).toMatchSnapshot(); | ||
}); |