Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scratch-www
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
scratch-www
Commits
ccb31f2f
Commit
ccb31f2f
authored
Aug 19, 2021
by
Eric Rosenbaum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add unit test for transfer host action
parent
dbf9b18d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
1 deletion
+24
-1
test/unit/redux/studio-member-actions.test.js
test/unit/redux/studio-member-actions.test.js
+24
-1
No files found.
test/unit/redux/studio-member-actions.test.js
View file @
ccb31f2f
...
...
@@ -7,7 +7,8 @@ import {
removeCurator
,
inviteCurator
,
promoteCurator
,
acceptInvitation
acceptInvitation
,
transferHost
}
from
'
../../../src/views/studio/lib/studio-member-actions
'
;
import
{
managers
,
curators
}
from
'
../../../src/views/studio/lib/redux-modules
'
;
import
{
reducers
,
initialState
}
from
'
../../../src/views/studio/studio-redux
'
;
...
...
@@ -399,4 +400,26 @@ describe('acceptInvitation', () => {
expect
(
state
.
studio
.
invited
).
toBe
(
true
);
expect
(
state
.
studio
.
curator
).
toBe
(
false
);
});
describe
(
'
transferHost
'
,
()
=>
{
beforeEach
(()
=>
{
store
=
configureStore
(
reducers
,
{
...
initialState
,
studio
:
{
id
:
123123
,
managers
:
3
}
});
});
test
(
'
transfers the host on success
'
,
async
()
=>
{
api
.
mockImplementation
((
opts
,
callback
)
=>
{
callback
(
null
,
{},
{
statusCode
:
200
});
});
await
store
.
dispatch
(
transferHost
(
'
password
'
,
'
newHostName
'
,
'
newHostId
'
));
const
state
=
store
.
getState
();
expect
(
api
.
mock
.
calls
[
0
][
0
].
uri
).
toBe
(
'
/studios/123123/transfer/newHostName?password=password
'
);
expect
(
state
.
studio
.
owner
).
toBe
(
'
newHostId
'
);
});
});
});
Write
Preview
Markdown
is supported
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