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
c3d266f3
Commit
c3d266f3
authored
May 03, 2021
by
Paul Kaplan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add in pending tests for missing project removal functionality
parent
0f8baaaa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
82 additions
and
73 deletions
+82
-73
test/unit/redux/studio-permissions.test.js
test/unit/redux/studio-permissions.test.js
+82
-73
No files found.
test/unit/redux/studio-permissions.test.js
View file @
c3d266f3
...
...
@@ -107,6 +107,7 @@ describe('studio projects', () => {
expect
(
selectCanAddProjects
(
state
)).
toBe
(
expected
);
});
});
describe
(
'
can remove projects
'
,
()
=>
{
test
.
each
([
[
'
admin
'
,
true
],
...
...
@@ -118,9 +119,11 @@ describe('studio projects', () => {
[
'
logged out
'
,
false
]
])(
'
%s: %s
'
,
(
role
,
expected
)
=>
{
setStateByRole
(
role
);
// TODO this permission is wrong, curators can only remove projects they added
expect
(
selectCanRemoveProjects
(
state
)).
toBe
(
expected
);
});
// TODO this permission is wrong, curators can only remove projects they added
test
.
skip
(
'
anyone can remove one of their projects
'
,
()
=>
{});
test
.
skip
(
'
curators can remove only projects they
'
,
()
=>
{});
});
});
...
...
@@ -232,92 +235,98 @@ describe('studio comments', () => {
expect
(
selectCanEditOpenToAll
(
state
)).
toBe
(
expected
);
});
});
describe
(
'
studio members
'
,
()
=>
{
describe
(
'
can accept invitation
'
,
()
=>
{
test
.
each
([
[
'
admin
'
,
false
],
[
'
curator
'
,
false
],
[
'
manager
'
,
false
],
[
'
creator
'
,
false
],
[
'
invited
'
,
true
],
[
'
logged in
'
,
false
],
[
'
unconfirmed
'
,
false
],
[
'
logged out
'
,
false
]
])(
'
%s: %s
'
,
(
role
,
expected
)
=>
{
setStateByRole
(
role
);
expect
(
selectShowCuratorInvite
(
state
)).
toBe
(
expected
);
});
});
describe
(
'
studio members
'
,
()
=>
{
describe
(
'
can accept invitation
'
,
()
=>
{
test
.
each
([
[
'
admin
'
,
false
],
[
'
curator
'
,
false
],
[
'
manager
'
,
false
],
[
'
creator
'
,
false
],
[
'
invited
'
,
true
],
[
'
logged in
'
,
false
],
[
'
unconfirmed
'
,
false
],
[
'
logged out
'
,
false
]
])(
'
%s: %s
'
,
(
role
,
expected
)
=>
{
setStateByRole
(
role
);
expect
(
selectShowCuratorInvite
(
state
)).
toBe
(
expected
);
});
describe
(
'
can promote curators
'
,
()
=>
{
test
.
each
([
[
'
admin
'
,
false
],
[
'
curator
'
,
false
],
[
'
manager
'
,
true
],
[
'
creator
'
,
true
],
[
'
logged in
'
,
false
],
[
'
unconfirmed
'
,
false
],
[
'
logged out
'
,
false
]
])(
'
%s: %s
'
,
(
role
,
expected
)
=>
{
setStateByRole
(
role
);
expect
(
selectCanPromoteCurators
(
state
)).
toBe
(
expected
);
});
});
describe
(
'
can promote curators
'
,
()
=>
{
test
.
each
([
[
'
admin
'
,
false
],
[
'
curator
'
,
false
],
[
'
manager
'
,
true
],
[
'
creator
'
,
true
],
[
'
logged in
'
,
false
],
[
'
unconfirmed
'
,
false
],
[
'
logged out
'
,
false
]
])(
'
%s: %s
'
,
(
role
,
expected
)
=>
{
setStateByRole
(
role
);
expect
(
selectCanPromoteCurators
(
state
)).
toBe
(
expected
);
});
describe
(
'
can remove curators
'
,
()
=>
{
test
.
each
([
[
'
admin
'
,
true
],
[
'
curator
'
,
false
],
[
'
manager
'
,
true
],
[
'
creator
'
,
true
],
[
'
logged in
'
,
false
],
[
'
unconfirmed
'
,
false
],
[
'
logged out
'
,
false
]
])(
'
%s: %s
'
,
(
role
,
expected
)
=>
{
setStateByRole
(
role
);
expect
(
selectCanRemoveCurators
(
state
)).
toBe
(
expected
);
});
});
describe
(
'
can remove curators
'
,
()
=>
{
test
.
each
([
[
'
admin
'
,
true
],
[
'
curator
'
,
false
],
[
'
manager
'
,
true
],
[
'
creator
'
,
true
],
[
'
logged in
'
,
false
],
[
'
unconfirmed
'
,
false
],
[
'
logged out
'
,
false
]
])(
'
%s: %s
'
,
(
role
,
expected
)
=>
{
setStateByRole
(
role
);
expect
(
selectCanRemoveCurators
(
state
)).
toBe
(
expected
);
});
describe
(
'
can remove managers
'
,
()
=>
{
test
.
each
([
[
'
admin
'
,
true
],
[
'
curator
'
,
false
],
[
'
manager
'
,
true
],
[
'
creator
'
,
true
],
[
'
logged in
'
,
false
],
[
'
unconfirmed
'
,
false
],
[
'
logged out
'
,
false
]
])(
'
%s: %s
'
,
(
role
,
expected
)
=>
{
setStateByRole
(
role
);
expect
(
selectCanRemoveManager
(
state
,
'
123
'
)).
toBe
(
expected
);
});
describe
(
'
nobody can remove the studio creator
'
,
()
=>
{
test
.
each
([
[
'
admin
'
,
false
],
[
'
curator
'
,
false
],
[
'
manager
'
,
false
],
[
'
creator
'
,
false
],
[
'
logged in
'
,
false
],
[
'
unconfirmed
'
,
false
],
[
'
logged out
'
,
false
]
])(
'
%s: %s
'
,
(
role
,
expected
)
=>
{
setStateByRole
(
role
);
state
.
studio
.
owner
=
'
the creator
'
;
expect
(
selectCanRemoveManager
(
state
,
'
the creator
'
)).
toBe
(
expected
);
});
});
});
describe
(
'
can remove managers
'
,
()
=>
{
test
.
each
([
[
'
admin
'
,
true
],
[
'
curator
'
,
false
],
[
'
manager
'
,
true
],
[
'
creator
'
,
true
],
[
'
logged in
'
,
false
],
[
'
unconfirmed
'
,
false
],
[
'
logged out
'
,
false
]
])(
'
%s: %s
'
,
(
role
,
expected
)
=>
{
setStateByRole
(
role
);
expect
(
selectCanRemoveManager
(
state
,
'
123
'
)).
toBe
(
expected
);
});
describe
(
'
can invite curators
'
,
()
=>
{
describe
(
'
nobody can remove the studio creator
'
,
()
=>
{
test
.
each
([
[
'
admin
'
,
false
],
[
'
curator
'
,
false
],
[
'
manager
'
,
tru
e
],
[
'
manager
'
,
fals
e
],
[
'
creator
'
,
false
],
[
'
logged in
'
,
false
],
[
'
unconfirmed
'
,
false
],
[
'
logged out
'
,
false
]
])(
'
%s: %s
'
,
(
role
,
expected
)
=>
{
setStateByRole
(
role
);
expect
(
selectCanInviteCurators
(
state
)).
toBe
(
expected
);
state
.
studio
.
owner
=
'
the creator
'
;
expect
(
selectCanRemoveManager
(
state
,
'
the creator
'
)).
toBe
(
expected
);
});
});
});
describe
(
'
can invite curators
'
,
()
=>
{
test
.
each
([
[
'
admin
'
,
false
],
[
'
curator
'
,
false
],
[
'
manager
'
,
true
],
[
'
creator
'
,
false
],
[
'
logged in
'
,
false
],
[
'
unconfirmed
'
,
false
],
[
'
logged out
'
,
false
]
])(
'
%s: %s
'
,
(
role
,
expected
)
=>
{
setStateByRole
(
role
);
expect
(
selectCanInviteCurators
(
state
)).
toBe
(
expected
);
});
});
});
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