@internetarchive/collection-browser 2.20.1-alpha-webdev7822.1 → 2.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -495,6 +495,33 @@ describe('Collection Browser', () => {
495
495
  expect(el.searchType).to.equal(SearchType.FULLTEXT);
496
496
  });
497
497
 
498
+ it('does not persist or restore search type from URL param if suppressed', async () => {
499
+ // Add a sin=TXT param to the URL
500
+ let url = new URL(window.location.href);
501
+ url.searchParams.append('sin', 'TXT');
502
+ window.history.replaceState({}, '', url);
503
+
504
+ const searchService = new MockSearchService();
505
+
506
+ const el = await fixture<CollectionBrowser>(
507
+ html`<collection-browser
508
+ .searchService=${searchService}
509
+ suppressURLSinParam
510
+ >
511
+ </collection-browser>`,
512
+ );
513
+
514
+ url = new URL(window.location.href);
515
+ expect(el.searchType).to.equal(SearchType.DEFAULT);
516
+ expect(url.searchParams.has('sin')).to.be.false; // Removes existing sin param
517
+
518
+ el.searchType = SearchType.RADIO;
519
+ await el.updateComplete;
520
+
521
+ url = new URL(window.location.href);
522
+ expect(url.searchParams.has('sin')).to.be.false; // Doesn't add sin param
523
+ });
524
+
498
525
  it('can construct tile models with many fields present', async () => {
499
526
  const searchService = new MockSearchService();
500
527