Skip to content

Commit 36d55b5

Browse files
dnlzroMarcelCoding
andauthored
search: fix results not loading on direct URL entry (#353)
Co-authored-by: Marcel <me@m4rc3l.de>
1 parent 10a0c24 commit 36d55b5

2 files changed

Lines changed: 21 additions & 3 deletions

File tree

e2e/search.spec.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ test('typing a query returns search option results', async ({ page }) => {
1313
await expect(page.getByRole('cell', { name: 'Whether to enable the Firefox web browser.', exact: true })).toBeVisible()
1414
});
1515

16+
test('deeplnk with query returns search option results', async ({ page }) => {
17+
await page.goto('/?query=fire*ox*able');
18+
19+
const searchResultEntry = page.getByRole('link', { name: 'programs.firefox.enable', exact: true });
20+
await expect(searchResultEntry).toBeVisible()
21+
await searchResultEntry.click()
22+
23+
await expect(page.getByRole('cell', { name: 'Whether to enable the Firefox web browser.', exact: true })).toBeVisible()
24+
});
25+
1626
test('typing a query returns search package results', async ({ page }) => {
1727
await page.goto('/');
1828

@@ -30,3 +40,14 @@ test('typing a query returns search package results', async ({ page }) => {
3040
await expect(page.getByRole('cell', { name: 'Web browser built from Firefox source tree', exact: true })).toBeVisible()
3141
});
3242

43+
test('deeplnk with query returns search package results', async ({ page }) => {
44+
await page.goto('/packages?query=fire*ox');
45+
46+
const searchResultEntry = page.getByRole('link', { name: 'firefox', exact: true });
47+
await expect(searchResultEntry).toBeVisible()
48+
await searchResultEntry.click()
49+
50+
await expect(page.getByRole('cell', { name: 'Web browser built from Firefox source tree', exact: true })).toBeVisible()
51+
});
52+
53+

src/app/core/components/search/search.component.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,6 @@ export class SearchComponent<T> {
117117
const { query, scope } = getQuery(this.activatedRoute);
118118
const id = this.scopes.find(s => s.name === scope)?.id ?? -1;
119119
this.search.setValue({ query: query ?? '', scope: id.toString() })
120-
121-
this.doSearch(scope === null ? null : Number(scope), query)
122-
.subscribe(value => this.results.next(value));
123120
}
124121

125122
protected ngOnDestroy0(): void {

0 commit comments

Comments
 (0)