Skip to content

Commit d76061a

Browse files
brianjgeigerbp-cos
authored andcommitted
Add data-test selectors to the Preprints detail page
1 parent 3c80a49 commit d76061a

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<div>
22
<h4>{{t 'preprints.detail.disciplines'}}</h4>
3-
{{#each this.disciplineReduced as |subject|}}
4-
<span local-class='subject-preview'>{{subject.text}}</span>
5-
{{/each}}
3+
<span data-test-subjects>
4+
{{#each this.disciplineReduced as |subject|}}
5+
<span local-class='subject-preview'>{{subject.text}}</span>
6+
{{/each}}
7+
</span>
68
</div>

app/preprints/-components/preprint-status-banner/template.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
{{else}}
1313
<div>
1414
<FaIcon @icon='{{this.icon}}' @prefix='far' local-class='status-icon' aria-hidden='true'/>
15-
<strong>{{t this.status }}:</strong>
16-
<span>{{this.bannerContent}}</span>
15+
<strong data-test-status>{{t this.status }}:</strong>
16+
<span data-test-status-explanation>{{this.bannerContent}}</span>
1717
</div>
1818
{{#if (and this.reviewerComment (not this.submission.provider.reviewsCommentsPrivate))}}
1919
<div local-class='reviewer-feedback'>

app/preprints/-components/preprint-tag/template.hbs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<div>
22
<h4>{{t 'preprints.detail.tags'}}</h4>
33
{{#if @preprint.tags.length}}
4-
{{#each @preprint.tags as |tag|}}
5-
<span local-class='badge'>{{tag}}</span>
6-
{{/each}}
4+
<span data-test-tags>
5+
{{#each @preprint.tags as |tag|}}
6+
<span local-class='badge'>{{tag}}</span>
7+
{{/each}}
8+
</span>
79
{{else}}
810
{{t 'preprints.detail.none'}}
911
{{/if}}

app/preprints/detail/template.hbs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
local-class='preprints-details-page-container {{if this.isMobile 'mobile'}}'
66
{{with-branding this.model.brand}}
77
data-analytics-scope='preprints detail page'
8+
data-test-preprint-header
89
>
910
<div local-class='header-container'>
1011
<div local-class='preprint-title-container'>
11-
<h1>{{this.model.preprint.title}}</h1>
12+
<h1 data-test-preprint-title>{{this.model.preprint.title}}</h1>
1213
{{#unless this.model.preprint.isWithdrawn}}
1314
<div class='edit-preprint-button'>
1415
{{#if (and this.userIsContrib (not this.isPendingWithdrawal))}}
@@ -122,7 +123,14 @@
122123
</OsfLink>
123124
</div>
124125
<div>
125-
{{t 'preprints.detail.share.views'}}: {{this.model.preprint.apiMeta.metrics.views}} | {{t 'preprints.detail.share.downloads'}}: {{this.model.preprint.apiMeta.metrics.downloads}}
126+
<span data-test-view-count-label>
127+
{{t 'preprints.detail.share.views'}}:
128+
</span>
129+
<span data-test-view-count> {{this.model.preprint.apiMeta.metrics.views}} </span> |
130+
<span data-test-download-count-label>
131+
{{t 'preprints.detail.share.downloads'}}:
132+
</span>
133+
<span data-test-download-count>{{this.model.preprint.apiMeta.metrics.downloads}}</span>
126134
<EmberTooltip>
127135
{{t 'preprints.detail.share.metrics_disclaimer'}} {{moment-format this.metricsStartDate 'YYYY-MM-DD'}}
128136
</EmberTooltip>

0 commit comments

Comments
 (0)