Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
ThaliApp
Commits
7bb91475
Commit
7bb91475
authored
Feb 14, 2018
by
Wietse Kuipers
Browse files
Merge branch 'feature/reducer-test' into 'master'
Add test for calendar reducer See merge request
!143
parents
ed6a23e1
30d11699
Changes
2
Hide whitespace changes
Inline
Side-by-side
__tests__/reducers/__snapshots__/calendar.spec.js.snap
0 → 100644
View file @
7bb91475
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`calendar reducer initially should not be fetched 1`] = `
Object {
"eventList": Array [],
"loading": true,
"status": "initial",
}
`;
__tests__/reducers/calendar.spec.js
0 → 100644
View file @
7bb91475
import
reducer
from
'
../../app/reducers/calendar
'
;
import
*
as
actions
from
'
../../app/actions/calendar
'
;
describe
(
'
calendar reducer
'
,
()
=>
{
const
initial
=
reducer
();
describe
(
'
initially
'
,
()
=>
{
it
(
'
should not be fetched
'
,
()
=>
{
expect
(
initial
).
toMatchSnapshot
();
});
});
describe
(
'
is refreshing
'
,
()
=>
{
const
state
=
reducer
(
{
loading
:
false
},
actions
.
refresh
(),
);
it
(
'
should be loading
'
,
()
=>
{
expect
(
state
).
toHaveProperty
(
'
loading
'
,
true
);
});
});
describe
(
'
is successful
'
,
()
=>
{
const
state
=
reducer
(
initial
,
actions
.
success
([{
pk
:
1
}]),
);
it
(
'
should not be loading
'
,
()
=>
{
expect
(
state
).
toHaveProperty
(
'
loading
'
,
false
);
});
it
(
'
should have events
'
,
()
=>
{
expect
(
state
).
toHaveProperty
(
'
eventList
'
,
[{
pk
:
1
}]);
});
it
(
'
should have status success
'
,
()
=>
{
expect
(
state
).
toHaveProperty
(
'
status
'
,
'
success
'
);
});
});
describe
(
'
is failure
'
,
()
=>
{
const
state
=
reducer
(
initial
,
actions
.
failure
(),
);
it
(
'
should not be loading
'
,
()
=>
{
expect
(
state
).
toHaveProperty
(
'
loading
'
,
false
);
});
it
(
'
should not have events
'
,
()
=>
{
expect
(
state
).
toHaveProperty
(
'
eventList
'
,
[]);
});
it
(
'
should have status failure
'
,
()
=>
{
expect
(
state
).
toHaveProperty
(
'
status
'
,
'
failure
'
);
});
});
});
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment