Skip to content

Commit 0428cb5

Browse files
authored
Merge pull request #390 from pressbooks/dev
v2.3 release
2 parents 9140f08 + 7809f68 commit 0428cb5

File tree

20 files changed

+85
-59
lines changed

20 files changed

+85
-59
lines changed

.env.example

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
VITE_ALGOLIA_APP_ID=
22
VITE_ALGOLIA_API_READ_KEY=
33
VITE_ALGOLIA_INDEX=
4-
VITE_ALGOLIA_INDEX_WORD_COUNT_REPLICA=
4+
VITE_ALGOLIA_INDEX_ALPHABETICAL_REPLICA=
55
VITE_ALGOLIA_INDEX_LAST_UPDATED_REPLICA=
66
VITE_HEADER_ADDITIONAL_TEXT=
7-
VITE_HEADER_ADDITIONAL_TEXT=
87
VITE_USER_NODE_ENV=
98
VITE_APP_GA_MEASUREMENT_ID=
109
BROWSERSTACK_USERNAME=

.github/workflows/pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
VITE_ALGOLIA_APP_ID: ${{ secrets.VITE_ALGOLIA_APP_ID }}
1616
VITE_ALGOLIA_API_READ_KEY: ${{ secrets.VITE_ALGOLIA_API_READ_KEY }}
1717
VITE_ALGOLIA_INDEX: ${{ secrets.VITE_ALGOLIA_INDEX }}
18-
VITE_ALGOLIA_INDEX_WORD_COUNT_REPLICA: ${{ secrets.VITE_ALGOLIA_INDEX_WORD_COUNT_REPLICA }}
18+
VITE_ALGOLIA_INDEX_ALPHABETICAL_REPLICA: ${{ secrets.VITE_ALGOLIA_INDEX_ALPHABETICAL_REPLICA }}
1919
VITE_ALGOLIA_INDEX_LAST_UPDATED_REPLICA: ${{ secrets.VITE_ALGOLIA_INDEX_LAST_UPDATED_REPLICA }}
2020
VITE_USER_NODE_ENV: ${{ secrets.VITE_USER_NODE_ENV }}
2121
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}

e2e/integration/bookCards.spec.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,5 +179,13 @@ describe('Book cards', function () {
179179
.should('not.contain', 'Read more')
180180
.should('contain', 'Seventeen countries are represented, including the United States.');
181181
});
182+
it('Fallback to cover image if image is not available', () => {
183+
search('math');
184+
185+
cy.get(Elements.booksCards.cover)
186+
.eq(1).find('img')
187+
.should('have.attr', 'src')
188+
.should('include', '/assets/images/default-book-cover.jpg');
189+
});
182190
});
183191
});

e2e/integration/filters/bookCardFilters.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ describe('BookCard Collections Filters', () => {
44
context('Desktop Resolution', () => {
55
it('Collection filter toggle', () => {
66

7-
cy.visit('/?collec=OpenStax');
7+
cy.visit('/?sort=updated&collec=OpenStax');
88

99
cy.algoliaQueryRequest('algoliaRequest');
1010

@@ -38,7 +38,7 @@ describe('BookCard Collections Filters', () => {
3838
.find('li:first-child button')
3939
.should('have.class', 'text-pb-red');
4040

41-
cy.url().should('include','?collec=OpenStax');
41+
cy.url().should('include','collec=OpenStax');
4242

4343
});
4444

e2e/integration/filters/clearFilters.spec.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
clickFilter,
55
perPage,
66
search,
7-
sortBy
87
} from '../../support/common';
98
import Elements from '../../support/elements';
109

@@ -20,7 +19,7 @@ describe('Clear Filters',() => {
2019

2120
it('Clear chip refinement', () => {
2221
cy.url()
23-
.should('include','?license=CC%20BY');
22+
.should('include','license=CC%20BY');
2423

2524
cy.get('[data-cy=chip-filter]').should('have.length', 3);
2625

@@ -31,12 +30,12 @@ describe('Clear Filters',() => {
3130
cy.get('[data-cy=chip-filter]').should('have.length', 2);
3231

3332
cy.url()
34-
.should('include','?license=CC%20BY-NC-SA%26%26All%20Rights%20Reserved');
33+
.should('include','license=CC%20BY-NC-SA%26%26All%20Rights%20Reserved');
3534
});
3635

3736
it('Clear all refinements', () => {
3837
cy.url()
39-
.should('include','?license=CC%20BY');
38+
.should('include','license=CC%20BY');
4039

4140
cy.get('[data-cy=chip-filter]').should('have.length', 3);
4241

@@ -47,12 +46,11 @@ describe('Clear Filters',() => {
4746
cy.get('[data-cy=chip-filter]').should('have.length', 0);
4847

4948
cy.url()
50-
.should('not.contain','?');
49+
.should('not.contain','&');
5150
});
5251

5352
it('Clear all refinements should not reset search, per page, and sorting', () => {
5453
perPage(20);
55-
sortBy('Word count');
5654
search('education');
5755

5856
cy.url()

e2e/integration/filters/collections.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe('Filter collections', () => {
2727
});
2828

2929
it('Filter by Interactive OER collection using URL', () => {
30-
cy.visit('http://localhost:3001/?collec=Interactive%20OER')
30+
cy.visit('/?sort=updated&collec=Interactive%20OER')
3131
.algoliaQueryRequest()
3232
.get('[data-cy=chip-filter]')
3333
.find('.text-sm')

e2e/integration/filters/lastUpdated.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ describe('Filter last updated', () => {
110110
});
111111

112112
it('Applying "start date" using the URL filters books that were modified since then', () => {
113-
cy.visit('/?updated=%3E%3D1619481600');
113+
cy.visit('/?sort=updated&updated=%3E%3D1619481600');
114114

115115
cy.algoliaQueryRequest()
116116
.get('[data-cy=chip-filter]')
@@ -130,7 +130,7 @@ describe('Filter last updated', () => {
130130
});
131131

132132
it('Applying "to date" using the URL filters books that were modified until then', () => {
133-
cy.visit('/?updated=%3C%3D1619567999');
133+
cy.visit('/?sort=updated&updated=%3C%3D1619567999');
134134

135135
cy.algoliaQueryRequest()
136136
.get('[data-cy=chip-filter]')
@@ -146,7 +146,7 @@ describe('Filter last updated', () => {
146146
});
147147

148148
it('Applying "start date" and "to date" using the URL filters books that were modified in between', () => {
149-
cy.visit('/?updated=%3E%3D1617235200%26%26%3C%3D1617407999');
149+
cy.visit('/?sort=updated&updated=%3E%3D1617235200%26%26%3C%3D1617407999');
150150

151151
cy.algoliaQueryRequest()
152152
.get('[data-cy=chip-filter]')
@@ -170,7 +170,7 @@ describe('Filter last updated', () => {
170170
});
171171

172172
it('Removing chip will remove the date filter', () => {
173-
cy.visit('/?updated=%3C%3D1619567999');
173+
cy.visit('/?sort=updated&updated=%3C%3D1619567999');
174174

175175
cy.get('@toLastUpdated').should('contain.value', 'April 27, 2021');
176176

e2e/integration/pagination.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ describe('Pagination', () => {
6363
});
6464

6565
it('Set page using URL',() => {
66-
cy.visit('/?p=2');
66+
cy.visit('/?sort=updated&p=2');
6767
cy.algoliaQueryRequest('algoliaRequest')
6868
.get(Elements.paginatorLink(2)).should('have.class','font-bold');
6969
cy.get('@firstBookTitle').contains('Physics 103 and 104 Teaching Guide');
7070
});
7171

7272
it('Set page and search term using URL',() => {
73-
cy.visit('/?p=2&q=biology');
73+
cy.visit('/?sort=updated&p=2&q=biology');
7474
cy.algoliaQueryRequest('algoliaRequest');
7575
cy.get(Elements.paginatorLink(2)).should('have.class','font-bold');
7676
cy.get('@firstBookTitle').contains('A Mixed Course-Based Research Approach to Human Physiology');

e2e/integration/perPage.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('Books per page', () => {
2525
it('Changes the amount of books displayed when requested by URL', () => {
2626
[20, 50].forEach(length => {
2727
cy.intercept('**/indexes/*/queries?*').as(`listing${length}`);
28-
cy.visit(`/?per_page=${length}`);
28+
cy.visit(`/?sort=updated&per_page=${length}`);
2929
cy.algoliaQueryRequest('listing');
3030
cy.wait(`@listing${length}`).then(() => {
3131
cy.get('[data-cy=book-card]').should('have.length', length);

e2e/integration/search.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('Search', () => {
1616

1717
cy.get('[data-cy=book-card]').should('have.length', 2);
1818
cy.url()
19-
.should('include','?q=math%20science');
19+
.should('include','q=math%20science');
2020

2121
});
2222

@@ -41,7 +41,7 @@ describe('Search', () => {
4141

4242
cy.get('[data-cy=book-card]').should('have.length', 2);
4343
cy.url()
44-
.should('include','?q=math%20science');
44+
.should('include','q=math%20science');
4545

4646
cy.get(Elements.returnHomeButton).click();
4747

0 commit comments

Comments
 (0)