Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Add the new VR tests
Browse files Browse the repository at this point in the history
Remove the Chrome search input cross in tailwind.css
Move the `self-center` class to weblink button
Add updated snapshots

Extract changes from #1930
  • Loading branch information
obulat committed Oct 28, 2022
1 parent b7c60a7 commit 8958b3d
Show file tree
Hide file tree
Showing 184 changed files with 49 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/components/VCopyButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
type="button"
variant="secondary-filled"
size="disabled"
class="py-2 px-3 text-sr font-semibold"
class="py-2 px-3 text-sr font-bold"
:data-clipboard-target="el"
>
<span v-if="!success">
Expand Down
1 change: 0 additions & 1 deletion src/components/VHeader/VHeaderMobile/VHeaderMobile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
>
<VInputModal
class="flex w-full"
variant="recent-searches"
:is-active="isRecentSearchesModalOpen"
@close="deactivate"
>
Expand Down
10 changes: 0 additions & 10 deletions src/components/VHeader/VSearchBar/VSearchBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,3 @@ export default defineComponent({
},
})
</script>

<style>
/* Removes the cross icon to clear the field */
.search-field input[type='search']::-webkit-search-decoration,
.search-field input[type='search']::-webkit-search-cancel-button,
.search-field input[type='search']::-webkit-search-results-button,
.search-field input[type='search']::-webkit-search-results-decoration {
-webkit-appearance: none;
}
</style>
1 change: 1 addition & 0 deletions src/components/VHeaderOld/VHeaderOld.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
:is-fetching="isFetching"
:is-header-scrolled="isHeaderScrolled"
:is-search-route="isSearchRoute"
class="md:h-12"
/>

<VSearchBarOld
Expand Down
2 changes: 1 addition & 1 deletion src/components/VMediaInfo/VMediaLicense.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="media-attribution">
<h3 class="description md:heading-6 mb-4">
<h3 class="description-bold md:heading-6 mb-4">
{{ headerText }}
</h3>

Expand Down
8 changes: 4 additions & 4 deletions test/playwright/e2e/search-query-client-old.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
changeContentType,
goToSearchTerm,
OLD_HEADER,
searchFromHeader,
} from '~~/test/playwright/utils/navigation'
import { mockProviderApis } from '~~/test/playwright/utils/route'

Expand Down Expand Up @@ -70,8 +71,8 @@ test('url filter types not used by current mediaType are discarded', async ({

test('can search for a different term', async ({ page }) => {
await goToSearchTerm(page, 'cat', { searchType: IMAGE })
await page.fill('header input[type="search"]', 'dog')
await page.keyboard.press('Enter')
await searchFromHeader(page, 'dog')

await expect(page).toHaveURL('/search/image?q=dog')
})

Expand All @@ -80,7 +81,6 @@ test('search for a different term keeps query parameters', async ({ page }) => {
searchType: IMAGE,
query: 'license=by&extension=jpg',
})
await page.fill('header input[type="search"]', 'dog')
await page.keyboard.press('Enter')
await searchFromHeader(page, 'dog')
await expect(page).toHaveURL('/search/image?q=dog&license=by&extension=jpg')
})
2 changes: 1 addition & 1 deletion test/playwright/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const config: PlaywrightTestConfig = {
expect: {
toMatchSnapshot: {
// To avoid flaky tests, we allow a small amount of pixel difference.
maxDiffPixelRatio: 0.06,
maxDiffPixelRatio: 0.02,
},
},
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions test/playwright/visual-regression/components/audio-results.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { test } from '@playwright/test'

import breakpoints from '~~/test/playwright/utils/breakpoints'
import {
closeFilters,
enableNewHeader,
} from '~~/test/playwright/utils/navigation'

test.describe.configure({ mode: 'parallel' })

test.describe('audio results', () => {
test.beforeEach(async ({ page }) => {
await enableNewHeader(page)
await page.goto('/search/audio?q=birds')
})

breakpoints.describeEachMobile({ uaMocking: false }, ({ expectSnapshot }) => {
test('should render small row layout desktop UA with narrow viewport', async ({
page,
}) => {
await expectSnapshot('audio-results-narrow-viewport-desktop-UA', page)
})
})

breakpoints.describeEachMobile({ uaMocking: true }, ({ expectSnapshot }) => {
test('should render small row layout mobile UA with narrow viewport', async ({
page,
}) => {
await expectSnapshot('audio-results-narrow-viewport-mobile-UA', page)
})
})

breakpoints.describeEachDesktop(({ expectSnapshot }) => {
test('desktop audio results', async ({ page }) => {
await closeFilters(page)
// Make sure filters button is not hovered
await page.mouse.move(0, 150)
await expectSnapshot('audio-results-desktop', page)
})
})
})
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8958b3d

Please sign in to comment.