Skip to content

Commit df4cd64

Browse files
committed
Tests
1 parent 323e4fb commit df4cd64

File tree

5 files changed

+3726
-641
lines changed

5 files changed

+3726
-641
lines changed

test/helpers/fetch-mocker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import adoptionFormData from '../src/data/adoption-form';
2-
import allBooksData from '../src/data/all-books';
2+
import allBooksData from '../src/data/all-books.json';
33
import amazonBlurb from '../src/data/amazon-blurb';
44
import algebraData from '../src/data/details-college-algebra';
55
import assignableData from '../src/data/assignable.json';
@@ -67,7 +67,7 @@ global.fetch = jest.fn().mockImplementation((...args) => {
6767
const isBlogCollection = args[0].includes('blogcollection');
6868
const isBooks = (/api\/books/).test(args[0]);
6969
const isBooksForAnalytics = (/book_student_resources/).test(args[0]);
70-
const isBookTitles = (/fields=title,id/).test(args[0]);
70+
const isBookTitles = args[0].endsWith('pages/?type=books.Book&fields=title,id,book_state,promote_snippet&limit=250');
7171
const isBuyprint = args[0].includes('buyprint');
7272
const isChemistry = args[0].endsWith('pages/93/?format=json');
7373
const isDonationPopup = args[0].includes('donation-popup');

test/src/components/book-selector.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ describe('book-selector', () => {
4747
render(<Component route='/selector?Calculus' />);
4848
const checkboxes = await screen.findAllByRole('checkbox');
4949

50-
expect(checkboxes).toHaveLength(9);
50+
expect(checkboxes).toHaveLength(58);
5151
const checked = await screen.findByRole('checkbox', {checked: true});
5252
const unchecked = screen.getAllByRole('checkbox', {checked: false});
5353

0 commit comments

Comments
 (0)