import {render, screen} from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import {beforeEach, describe, expect, it, vi} from 'vitest'; import SeedLibrary from './SeedLibrary'; vi.mock('../islands', () => ({mountIslands: vi.fn(), unmountIslands: vi.fn()})); vi.mock('./CropPicker', () => ({ default: ({label, onChoose}) => , })); const props = { scope: '', tabs: '', html: '

First results

', groups: [['crop', 'Crop'], ['year', 'Year']], filters: [ { label: 'Source', chips: [ {label: 'All', params: {from: null, heirloom: null}}, {label: 'Bought', params: {from: 'bought'}}, {label: 'Heirloom', params: {heirloom: 'heirloom'}}, ], }, {label: 'Planted', chips: [{label: 'Not planted yet', params: {planted: 'no'}}]}, { label: 'Month to sow', wide_only: true, chips: [{label: 'Any month', params: {sow_month: null}}, {label: 'September', params: {sow_month: 9}}], }, ], months: [[1, 'January'], [9, 'September']], sow_now: 'Sow now (November)', gardeners: ['Amy', 'Zed'], clear: {from: null, heirloom: null, sow_month: null, crop: null}, crop: null, crop_search: true, placeholder: 'Find a crop', }; function stubFetch(body = {scope: '', tabs: '