Skip to content

Commit

Permalink
Deploy Sep 09, 2024 (#745)
Browse files Browse the repository at this point in the history
[beatrice-acasandrei] PCF-503 Increase the count of the returned search (#735)
[beatrice-acasandrei] PCF-497 The warning icon showing up when comparing try vs mozilla-central sho… (#736)
[esanuandra] PCF-506 Always show the graphs (#734)
[Julien Wajsberg] Populate the search form in the home page from the URL (#730)
[Julien Wajsberg] Increase range of the kde graph and other tweaks (#740)
[Nazım Can Altınova] Persist the search term in the url (#724)
[Carla Severe] PCF-439 Serve imgs from project src vs github (#742)
[beatrice-acasandrei] Fixed the fetch for compare over time subtests (#743)
  • Loading branch information
julienw authored Sep 3, 2024
2 parents c04f33d + 68a7dee commit 105413c
Show file tree
Hide file tree
Showing 39 changed files with 5,479 additions and 1,980 deletions.
37 changes: 37 additions & 0 deletions src/__tests__/CompareResults/SearchInput.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,41 @@ describe('Search by title/test name', () => {
await user.click(clearButton);
expect(screen.getByText('spam')).toBeInTheDocument();
});

it('should update the url search params properly', async () => {
await setupAndRenderComponent();

const searchInput = await screen.findByRole('textbox', {
name: /Search by title/,
});

// set delay to null to prevent test time-out due to useFakeTimers
const user = userEvent.setup({ delay: null });

// With the mock setup in this test, there are 2 results with different
// properties. In this test we make each of the input show and disappear in
// an alternance, by searching for the values in the different properties.
await user.type(searchInput, 'glvideo');
await waitFor(() =>
expect(screen.queryByText('a11yr')).not.toBeInTheDocument(),
);
// Make sure that the search params are updated properly.
expect(window.location.search).toContain('&search=glvideo');

await user.clear(searchInput);
expect(await screen.findByText('a11yr')).toBeInTheDocument();
// Clearing the search should remove the search param.
expect(window.location.search).not.toContain('&search');

await user.type(searchInput, 'a11yr{Enter}');
// With enter the update should happen instantly.
expect(window.location.search).toContain('&search=a11yr');

const clearButton = screen.getByRole('button', {
name: 'Clear the search input',
});
await user.click(clearButton);
// Clearing the search through button should also remove the search param.
expect(window.location.search).not.toContain('&search');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports[`Results Table Should match snapshot 1`] = `
data-testid="beta-version-compare-results"
>
<div
class="MuiGrid-root header-container container_f18obq8l css-plh9qo-MuiGrid-root"
class="MuiGrid-root header-container container_f1ocj467 css-plh9qo-MuiGrid-root"
>
<div
class="toggle-dark-mode f10ie5uy MuiBox-root css-0"
Expand Down Expand Up @@ -92,7 +92,7 @@ exports[`Results Table Should match snapshot 1`] = `
class="MuiGrid-root wrapper--withbase fcdpsbx css-plh9qo-MuiGrid-root"
>
<div
class="compare-card-container compare-card-container--expanded container_f1cct50y"
class="compare-card-container compare-card-container--expanded container_fbyd6x5"
data-testid="base-state"
>
<div
Expand All @@ -115,7 +115,7 @@ exports[`Results Table Should match snapshot 1`] = `
/>
</div>
<div
class="compare-card-container content-base content-base--expanded container_f1cct50y"
class="compare-card-container content-base content-base--expanded container_fbyd6x5"
>
<hr
class="MuiDivider-root MuiDivider-fullWidth divider css-9mgopn-MuiDivider-root"
Expand Down
Loading

0 comments on commit 105413c

Please sign in to comment.