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
384d3adc
Commit
384d3adc
authored
Aug 05, 2022
by
Lyza Danger Gardner
Committed by
Lyza Gardner
Aug 10, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure content-banner links open in a new tab
parent
b342720c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
ContentInfoBanner.js
src/annotator/components/ContentInfoBanner.js
+1
-0
ContentInfoBanner-test.js
src/annotator/components/test/ContentInfoBanner-test.js
+5
-2
No files found.
src/annotator/components/ContentInfoBanner.js
View file @
384d3adc
...
...
@@ -106,6 +106,7 @@ export default function ContentInfoBanner({ info }) {
title
=
{
itemTitle
}
href
=
{
info
.
links
.
currentItem
}
data
-
testid
=
"content-item-link"
target
=
"_blank"
>
{
itemTitle
}
<
/LinkUnstyled
>
...
...
src/annotator/components/test/ContentInfoBanner-test.js
View file @
384d3adc
...
...
@@ -46,8 +46,9 @@ describe('ContentInfoBanner', () => {
it
(
'shows item title'
,
()
=>
{
const
wrapper
=
createComponent
();
const
title
=
wrapper
.
find
(
'LinkUnstyled[data-testid="content-item-link"]'
);
assert
.
equal
(
title
.
text
(),
'Chapter 2: Some book chapter'
);
const
link
=
wrapper
.
find
(
'LinkUnstyled[data-testid="content-item-link"]'
);
assert
.
equal
(
link
.
text
(),
'Chapter 2: Some book chapter'
);
assert
.
equal
(
link
.
prop
(
'target'
),
'_blank'
);
});
it
(
'provides disclosure of long titles through title attributes'
,
()
=>
{
...
...
@@ -80,10 +81,12 @@ describe('ContentInfoBanner', () => {
prevLink
.
prop
(
'href'
),
'https://www.jstor.org/stable/book.123.1'
);
assert
.
equal
(
prevLink
.
prop
(
'target'
),
'_blank'
);
assert
.
equal
(
nextLink
.
prop
(
'href'
),
'https://www.jstor.org/stable/book.123.3'
);
assert
.
equal
(
nextLink
.
prop
(
'target'
),
'_blank'
);
});
it
(
'does not display previous link if unavailable'
,
()
=>
{
...
...
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