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
30d11699
Commit
30d11699
authored
Feb 10, 2018
by
Sébastiaan Versteeg
Browse files
Add test for calendar reducer
parent
22b402a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
__tests__/reducers/__snapshots__/calendar.spec.js.snap
0 → 100644
View file @
30d11699
// 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 @
30d11699
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