Skip to content
GitLab
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
9fdac134
Commit
9fdac134
authored
Oct 04, 2018
by
Gijs Hendriksen
Committed by
Gijs Hendriksen
Oct 10, 2018
Browse files
Updated/added action tests
parent
c15c614d
Changes
12
Hide whitespace changes
Inline
Side-by-side
__tests__/actions/__snapshots__/calendar.spec.js.snap
View file @
9fdac134
...
...
@@ -19,6 +19,18 @@ Object {
}
`;
exports[`calendar actions should create an action to notify the calendar is being fetched 1`] = `
Object {
"type": "CALENDAR_FETCHING",
}
`;
exports[`calendar actions should create an action to notify the calendar was opened 1`] = `
Object {
"type": "CALENDAR_OPEN",
}
`;
exports[`calendar actions should create an action to refresh the calendar 1`] = `
Object {
"type": "CALENDAR_REFRESH",
...
...
__tests__/actions/__snapshots__/members.spec.js.snap
0 → 100644
View file @
9fdac134
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`member actions should create an action to notify additional members should be retrieved 1`] = `
Object {
"payload": Object {
"url": "nextUrl",
},
"type": "MEMBERS_MORE",
}
`;
exports[`member actions should create an action to notify of a failure fetching the member list 1`] = `
Object {
"type": "MEMBERS_FAILURE",
}
`;
exports[`member actions should create an action to notify the additional members were fetched successfully 1`] = `
Object {
"payload": Object {
"memberList": Array [
"John Doe",
"Jane Doe",
],
"next": "nextUrl",
},
"type": "MEMBERS_MORE_SUCCESS",
}
`;
exports[`member actions should create an action to notify the member list is being fetched 1`] = `
Object {
"type": "MEMBERS_FETCHING",
}
`;
exports[`member actions should create an action to notify the member list should be fetched unfiltered 1`] = `
Object {
"payload": Object {
"keywords": "",
},
"type": "MEMBERS_MEMBERS",
}
`;
exports[`member actions should create an action to notify the member list should be fetched, filtered by certain keywords 1`] = `
Object {
"payload": Object {
"keywords": "John Doe",
},
"type": "MEMBERS_MEMBERS",
}
`;
exports[`member actions should create an action to notify the member list was fetched successfully 1`] = `
Object {
"payload": Object {
"memberList": Array [
"John Doe",
"Jane Doe",
],
"next": "nextUrl",
"searchKey": "John Doe",
},
"type": "MEMBERS_MEMBERS_SUCCESS",
}
`;
__tests__/actions/__snapshots__/navigation.spec.js.snap
0 → 100644
View file @
9fdac134
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`navigation actions should create an action to notify the app drawer should be toggled 1`] = `
Object {
"type": "NAVIGATE_TOGGLE_DRAWER",
}
`;
exports[`navigation actions should create an action to notify the app should navigate back 1`] = `
Object {
"type": "NAVIGATE_BACK",
}
`;
__tests__/actions/__snapshots__/profile.spec.js.snap
View file @
9fdac134
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`
navigation
actions should create an action for a failed profile load 1`] = `
exports[`
profile
actions should create an action for a failed profile load 1`] = `
Object {
"type": "PROFILE_FAILURE",
}
`;
exports[`
navigation
actions should create an action for a successful profile load 1`] = `
exports[`
profile
actions should create an action for a successful profile load 1`] = `
Object {
"payload": Object {
"profileData": "profile",
...
...
@@ -15,25 +15,25 @@ Object {
}
`;
exports[`
navigation
actions should create an action for profile fetch 1`] = `
exports[`
profile
actions should create an action for profile fetch 1`] = `
Object {
"type": "PROFILE_FETCHING",
}
`;
exports[`
navigation
actions should create an action to load a profile 1`] = `
exports[`
profile
actions should create an action to load a profile 1`] = `
Object {
"payload": Object {
"member":
"token"
,
"member":
1
,
},
"type": "PROFILE_PROFILE",
}
`;
exports[`
navigation
actions should create an action to load
a profile 2
`] = `
exports[`
profile
actions should create an action to load
the user's own profile as default 1
`] = `
Object {
"payload": Object {
"member": "
abc123
",
"member": "
me
",
},
"type": "PROFILE_PROFILE",
}
...
...
__tests__/actions/__snapshots__/settings.spec.js.snap
0 → 100644
View file @
9fdac134
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`base settings actions should create an action to notify the settings screen has finished loading 1`] = `
Object {
"type": "SETTINGS_INIT_COMPLETE",
}
`;
exports[`base settings actions should create an action to notify the settings screen is loading 1`] = `
Object {
"type": "SETTINGS_INIT_START",
}
`;
exports[`base settings actions should create an action to open the settings screen 1`] = `
Object {
"type": "SETTINGS_OPEN",
}
`;
exports[`notifications settings actions should create an action to notify of a failure fetching the notifications settings 1`] = `
Object {
"type": "SETTINGS_PUSH_NOTIFICATIONS_FAILURE",
}
`;
exports[`notifications settings actions should create an action to notify the notifications settings were fetched successfully 1`] = `
Object {
"categoryList": Array [
Object {
"key": "general",
"name": "General",
},
],
"type": "SETTINGS_PUSH_NOTIFICATIONS_SUCCESS",
}
`;
exports[`notifications settings actions should create an action to save the push notifications category preferences 1`] = `
Object {
"categories": Array [
"general",
],
"type": "SETTINGS_PUSH_NOTIFICATIONS_SAVE_CATEGORIES",
}
`;
__tests__/actions/__snapshots__/welcome.spec.js.snap
View file @
9fdac134
...
...
@@ -15,6 +15,12 @@ Object {
}
`;
exports[`welcome actions should create an action to open the welcome screen 1`] = `
Object {
"type": "WELCOME_OPEN",
}
`;
exports[`welcome actions should create an action to refresh the view 1`] = `
Object {
"type": "WELCOME_REFRESH",
...
...
__tests__/actions/calendar.spec.js
View file @
9fdac134
...
...
@@ -2,9 +2,19 @@ import * as actions from '../../app/actions/calendar';
describe
(
'
calendar actions
'
,
()
=>
{
it
(
'
should expose the calendar actions
'
,
()
=>
{
expect
(
actions
.
OPEN
).
toEqual
(
'
CALENDAR_OPEN
'
);
expect
(
actions
.
REFRESH
).
toEqual
(
'
CALENDAR_REFRESH
'
);
expect
(
actions
.
SUCCESS
).
toEqual
(
'
CALENDAR_SUCCESS
'
);
expect
(
actions
.
FAILURE
).
toEqual
(
'
CALENDAR_FAILURE
'
);
expect
(
actions
.
REFRESH
).
toEqual
(
'
CALENDAR_REFRESH
'
);
expect
(
actions
.
FETCHING
).
toEqual
(
'
CALENDAR_FETCHING
'
);
});
it
(
'
should create an action to notify the calendar was opened
'
,
()
=>
{
expect
(
actions
.
open
()).
toMatchSnapshot
();
});
it
(
'
should create an action to notify the calendar is being fetched
'
,
()
=>
{
expect
(
actions
.
fetching
()).
toMatchSnapshot
();
});
it
(
'
should create an action to refresh the calendar
'
,
()
=>
{
...
...
__tests__/actions/members.spec.js
0 → 100644
View file @
9fdac134
import
*
as
actions
from
'
../../app/actions/members
'
;
describe
(
'
member actions
'
,
()
=>
{
it
(
'
should expose the member actions
'
,
()
=>
{
expect
(
actions
.
MEMBERS
).
toEqual
(
'
MEMBERS_MEMBERS
'
);
expect
(
actions
.
FETCHING
).
toEqual
(
'
MEMBERS_FETCHING
'
);
expect
(
actions
.
MEMBERS_SUCCESS
).
toEqual
(
'
MEMBERS_MEMBERS_SUCCESS
'
);
expect
(
actions
.
FAILURE
).
toEqual
(
'
MEMBERS_FAILURE
'
);
expect
(
actions
.
MORE
).
toEqual
(
'
MEMBERS_MORE
'
);
expect
(
actions
.
MORE_SUCCESS
).
toEqual
(
'
MEMBERS_MORE_SUCCESS
'
);
});
it
(
'
should create an action to notify the member list should be fetched unfiltered
'
,
()
=>
{
expect
(
actions
.
members
()).
toMatchSnapshot
();
});
it
(
'
should create an action to notify the member list should be fetched, filtered by certain keywords
'
,
()
=>
{
expect
(
actions
.
members
(
'
John Doe
'
)).
toMatchSnapshot
();
});
it
(
'
should create an action to notify the member list is being fetched
'
,
()
=>
{
expect
(
actions
.
fetching
()).
toMatchSnapshot
();
});
it
(
'
should create an action to notify the member list was fetched successfully
'
,
()
=>
{
expect
(
actions
.
success
([
'
John Doe
'
,
'
Jane Doe
'
],
'
nextUrl
'
,
'
John Doe
'
)).
toMatchSnapshot
();
});
it
(
'
should create an action to notify of a failure fetching the member list
'
,
()
=>
{
expect
(
actions
.
failure
()).
toMatchSnapshot
();
});
it
(
'
should create an action to notify additional members should be retrieved
'
,
()
=>
{
expect
(
actions
.
more
(
'
nextUrl
'
)).
toMatchSnapshot
();
});
it
(
'
should create an action to notify the additional members were fetched successfully
'
,
()
=>
{
expect
(
actions
.
moreSuccess
([
'
John Doe
'
,
'
Jane Doe
'
],
'
nextUrl
'
)).
toMatchSnapshot
();
});
});
\ No newline at end of file
__tests__/actions/navigation.spec.js
0 → 100644
View file @
9fdac134
import
*
as
actions
from
'
../../app/actions/navigation
'
;
describe
(
'
navigation actions
'
,
()
=>
{
it
(
'
should expose the navigation actions
'
,
()
=>
{
expect
(
actions
.
BACK
).
toEqual
(
'
NAVIGATE_BACK
'
);
expect
(
actions
.
TOGGLE_DRAWER
).
toEqual
(
'
NAVIGATE_TOGGLE_DRAWER
'
);
});
it
(
'
should create an action to notify the app should navigate back
'
,
()
=>
{
expect
(
actions
.
goBack
()).
toMatchSnapshot
();
});
it
(
'
should create an action to notify the app drawer should be toggled
'
,
()
=>
{
expect
(
actions
.
toggleDrawer
()).
toMatchSnapshot
();
});
});
__tests__/actions/profile.spec.js
View file @
9fdac134
import
*
as
actions
from
'
../../app/actions/profile
'
;
describe
(
'
navigation
actions
'
,
()
=>
{
it
(
'
should expose the
navigation
actions
'
,
()
=>
{
describe
(
'
profile
actions
'
,
()
=>
{
it
(
'
should expose the
profile
actions
'
,
()
=>
{
expect
(
actions
.
PROFILE
).
toEqual
(
'
PROFILE_PROFILE
'
);
expect
(
actions
.
FETCHING
).
toEqual
(
'
PROFILE_FETCHING
'
);
expect
(
actions
.
SUCCESS
).
toEqual
(
'
PROFILE_SUCCESS
'
);
...
...
@@ -9,8 +9,11 @@ describe('navigation actions', () => {
});
it
(
'
should create an action to load a profile
'
,
()
=>
{
expect
(
actions
.
profile
(
'
token
'
)).
toMatchSnapshot
();
expect
(
actions
.
profile
(
'
abc123
'
,
1
)).
toMatchSnapshot
();
expect
(
actions
.
profile
(
1
)).
toMatchSnapshot
();
});
it
(
'
should create an action to load the user
\'
s own profile as default
'
,
()
=>
{
expect
(
actions
.
profile
()).
toMatchSnapshot
();
});
it
(
'
should create an action for profile fetch
'
,
()
=>
{
...
...
__tests__/actions/settings.spec.js
0 → 100644
View file @
9fdac134
import
*
as
actions
from
'
../../app/actions/settings
'
;
describe
(
'
base settings actions
'
,
()
=>
{
it
(
'
should expose the base settings actions
'
,
()
=>
{
expect
(
actions
.
settingsActions
.
OPEN
).
toEqual
(
'
SETTINGS_OPEN
'
);
expect
(
actions
.
settingsActions
.
INIT_START
).
toEqual
(
'
SETTINGS_INIT_START
'
);
expect
(
actions
.
settingsActions
.
INIT_COMPLETE
).
toEqual
(
'
SETTINGS_INIT_COMPLETE
'
);
});
it
(
'
should create an action to open the settings screen
'
,
()
=>
{
expect
(
actions
.
settingsActions
.
open
()).
toMatchSnapshot
();
});
it
(
'
should create an action to notify the settings screen is loading
'
,
()
=>
{
expect
(
actions
.
settingsActions
.
initStart
()).
toMatchSnapshot
();
});
it
(
'
should create an action to notify the settings screen has finished loading
'
,
()
=>
{
expect
(
actions
.
settingsActions
.
initComplete
()).
toMatchSnapshot
();
});
});
describe
(
'
notifications settings actions
'
,
()
=>
{
it
(
'
should expose the notifications settings actions
'
,
()
=>
{
expect
(
actions
.
notificationsSettingsActions
.
SUCCESS
).
toEqual
(
'
SETTINGS_PUSH_NOTIFICATIONS_SUCCESS
'
);
expect
(
actions
.
notificationsSettingsActions
.
FAILURE
).
toEqual
(
'
SETTINGS_PUSH_NOTIFICATIONS_FAILURE
'
);
expect
(
actions
.
notificationsSettingsActions
.
SAVE_CATEGORIES
).
toEqual
(
'
SETTINGS_PUSH_NOTIFICATIONS_SAVE_CATEGORIES
'
);
});
it
(
'
should create an action to notify the notifications settings were fetched successfully
'
,
()
=>
{
expect
(
actions
.
notificationsSettingsActions
.
success
([{
key
:
'
general
'
,
name
:
'
General
'
}])).
toMatchSnapshot
();
});
it
(
'
should create an action to notify of a failure fetching the notifications settings
'
,
()
=>
{
expect
(
actions
.
notificationsSettingsActions
.
failure
()).
toMatchSnapshot
();
});
it
(
'
should create an action to save the push notifications category preferences
'
,
()
=>
{
expect
(
actions
.
notificationsSettingsActions
.
saveCategories
([
'
general
'
])).
toMatchSnapshot
();
});
});
__tests__/actions/welcome.spec.js
View file @
9fdac134
...
...
@@ -2,11 +2,16 @@ import * as actions from '../../app/actions/welcome';
describe
(
'
welcome actions
'
,
()
=>
{
it
(
'
should expose the welcome actions
'
,
()
=>
{
expect
(
actions
.
OPEN
).
toEqual
(
'
WELCOME_OPEN
'
);
expect
(
actions
.
REFRESH
).
toEqual
(
'
WELCOME_REFRESH
'
);
expect
(
actions
.
SUCCESS
).
toEqual
(
'
WELCOME_SUCCESS
'
);
expect
(
actions
.
FAILURE
).
toEqual
(
'
WELCOME_FAILURE
'
);
});
it
(
'
should create an action to open the welcome screen
'
,
()
=>
{
expect
(
actions
.
open
()).
toMatchSnapshot
();
});
it
(
'
should create an action to refresh the view
'
,
()
=>
{
expect
(
actions
.
refresh
()).
toMatchSnapshot
();
});
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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