Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated text for shopping cart delivery note #1476

Merged
merged 4 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions app/javascript/components/RequestCart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@
<tr v-else-if="item.location && item.location.label" class="request__location">
<td colspan="4">
<geo-icon></geo-icon>
View this item at the <template v-if="item.location.url"><a
:href="item.location.url" target="_blank">{{ item.location.label
}}</a></template><template v-else>{{ item.location.label }}</template>
This item can be viewed in person at <template v-if="item.location.url"><a
:href="item.location.url" target="_blank">{{ item.location.label.replace("Manuscript ", "")
}}</a></template><template v-else>{{ item.location.label.replace("Manuscript ", "") }}</template>.
These item(s) will be paged upon your arrival to the reading room.
</td>
</tr>

Expand Down
9 changes: 5 additions & 4 deletions app/javascript/test/requestCart.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('RequestCart.vue', () => {
},
location: {
notes: "It's far away",
label: 'Firestone Library',
label: 'Mudd Manuscript Library',
url: 'https://example.com'
}
}],
Expand Down Expand Up @@ -48,7 +48,8 @@ describe('RequestCart.vue', () => {
const notes = container.querySelector('.request__location-notes')
expect(notes.textContent).toMatch("It's far away")
const locationInfo = container.querySelector('.request__location')
expect(locationInfo.textContent).toMatch('View this item at the Firestone Library')
expect(locationInfo.textContent).toContain('This item can be viewed in person at Mudd Library.')
expect(locationInfo.textContent).toContain('These item(s) will be paged upon your arrival to the reading room.')
expect(locationInfo.querySelector('a').attributes.href.value).toBe('https://example.com')
})
test('Rendering locations with no url', async () => {
Expand All @@ -65,7 +66,7 @@ describe('RequestCart.vue', () => {
},
location: {
notes: "It's far away",
label: 'Firestone Library',
label: 'Mudd Manuscript Library',
url: null
}
}],
Expand All @@ -92,7 +93,7 @@ describe('RequestCart.vue', () => {
const notes = container.querySelector('.request__location-notes')
expect(notes.textContent).toMatch("It's far away")
const locationInfo = container.querySelector('.request__location')
expect(locationInfo.textContent).toMatch('View this item at the Firestone Library')
expect(locationInfo.textContent).toMatch('This item can be viewed in person at Mudd Library.')
expect(locationInfo.querySelector('a')).toBe(null)
})
test('Submitting cart', async () => {
Expand Down
2 changes: 1 addition & 1 deletion spec/features/catalog_view_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
expect(page).to have_selector "td", text: /MC148_c00002/
expect(page).to have_selector "td", text: /Box 1/
expect(page).to have_selector "button[type='submit']", text: /Request 1 Item/
expect(page).to have_selector ".request__location", text: /View this item at the/
expect(page).to have_selector ".request__location", text: /This item can be viewed in person/

# Click the remove item button
find("#item-MC148_c00002 > td > button").click
Expand Down