Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
a56c0ce0
Commit
a56c0ce0
authored
Apr 23, 2019
by
Hannah Stepanek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use same direct-linked group error when logged-in
parent
7cc4ad71
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletion
+28
-1
sidebar-content-test.js
src/sidebar/components/test/sidebar-content-test.js
+27
-0
sidebar-content.html
src/sidebar/templates/sidebar-content.html
+1
-1
No files found.
src/sidebar/components/test/sidebar-content-test.js
View file @
a56c0ce0
...
...
@@ -6,6 +6,7 @@ const EventEmitter = require('tiny-emitter');
const
events
=
require
(
'../../events'
);
const
sidebarContent
=
require
(
'../sidebar-content'
);
const
uiConstants
=
require
(
'../../ui-constants'
);
const
util
=
require
(
'../../directive/test/util'
);
let
searchClients
;
...
...
@@ -149,6 +150,19 @@ describe('sidebar.components.sidebar-content', function() {
});
}
function
createSidebarContent
(
{
userid
}
=
{
userid
:
'acct:person@example.com'
}
)
{
return
util
.
createDirective
(
document
,
'sidebarContent'
,
{
auth
:
{
status
:
userid
?
'logged-in'
:
'logged-out'
,
userid
:
userid
,
},
search
:
sinon
.
stub
().
returns
({
query
:
sinon
.
stub
()
}),
onLogin
:
sinon
.
stub
(),
});
}
const
makeSidebarContentController
=
()
=>
{
angular
.
mock
.
inject
(
function
(
$componentController
,
_store_
,
_$rootScope_
)
{
$rootScope
=
_$rootScope_
;
...
...
@@ -337,6 +351,19 @@ describe('sidebar.components.sidebar-content', function() {
makeSidebarContentController
();
});
[
null
,
'acct:person@example.com'
].
forEach
(
userid
=>
{
it
(
'displays same group error message regardless of login state'
,
()
=>
{
const
element
=
createSidebarContent
({
userid
});
const
sidebarContentError
=
element
.
find
(
'.sidebar-content-error'
);
const
errorMessage
=
sidebarContentError
.
attr
(
'logged-in-error-message'
);
assert
.
equal
(
errorMessage
,
"'This group is not available.'"
);
});
});
it
(
'sets directLinkedGroupFetchFailed to true'
,
()
=>
{
assert
.
isTrue
(
ctrl
.
directLinkedGroupFetchFailed
);
});
...
...
src/sidebar/templates/sidebar-content.html
View file @
a56c0ce0
...
...
@@ -36,7 +36,7 @@
<sidebar-content-error
class=
"sidebar-content-error"
logged-out-error-message=
"'This group is not available.'"
logged-in-error-message=
"'
You either do not have permission to view this group, the group does not exist, or the group is not visible at this URL
.'"
logged-in-error-message=
"'
This group is not available
.'"
on-login-request=
"vm.onLogin()"
is-logged-in=
"vm.auth.status === 'logged-in'"
ng-if=
"vm.selectedGroupUnavailable()"
...
...
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