This repository has been archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
Add pink border to VSearchButton on group hover #1286
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
53dc5a8
Add pink border to VSearchButton on group hover
obulat d51a556
Try adding visual regression tests
obulat e9c6614
Add hover
obulat f5449a9
Add snapshots
obulat c0fa198
Test visual regression tests :)
obulat d004845
Revert "Test visual regression tests :)"
obulat 70d0107
Add missing test tapes
obulat 73bf4b2
Unify SearchBar stories and TS-ify
obulat 3a18fd7
TS-ify VSearchBar
obulat 80d1a03
Reuse VInputField FIELD_SIZES constant in VSearchBar
obulat 1eafe04
Make snapshots for whole header
obulat 8a46962
Add snapshots
obulat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { test } from '@playwright/test' | ||
|
||
import breakpoints from '~~/test/playwright/utils/breakpoints' | ||
import { hideInputCursors } from '~~/test/playwright/utils/page' | ||
|
||
const headerSelector = '.main-header' | ||
const loadMoreSelector = 'button:has-text("Load more")' | ||
|
||
test.describe('header snapshots', () => { | ||
test.describe('ltr', () => { | ||
test.beforeEach(async ({ page }) => { | ||
await page.goto('/search/?q=birds') | ||
}) | ||
|
||
test.describe('header', () => { | ||
breakpoints.describeEvery(({ expectSnapshot }) => { | ||
test('resting', async ({ page }) => { | ||
await expectSnapshot('resting-ltr', page.locator(headerSelector)) | ||
}) | ||
|
||
test('scrolled', async ({ page }) => { | ||
await page.locator(loadMoreSelector).focus() | ||
await expectSnapshot('scrolled-ltr', page.locator(headerSelector)) | ||
}) | ||
|
||
test('searchbar hovered', async ({ page }) => { | ||
await page.hover('input') | ||
await hideInputCursors(page) | ||
await expectSnapshot( | ||
'searchbar-hovered-ltr', | ||
page.locator(headerSelector) | ||
) | ||
}) | ||
}) | ||
}) | ||
}) | ||
|
||
test.describe('rtl', () => { | ||
test.beforeEach(async ({ page }) => { | ||
await page.goto('/ar/search/?q=birds') | ||
}) | ||
|
||
test.describe('header', () => { | ||
breakpoints.describeEvery(({ expectSnapshot }) => { | ||
test('resting', async ({ page }) => { | ||
await expectSnapshot('resting-rtl', page.locator(headerSelector)) | ||
}) | ||
|
||
test('scrolled', async ({ page }) => { | ||
await page.locator(loadMoreSelector).focus() | ||
await page.mouse.wheel(10, 0) | ||
await expectSnapshot('scrolled-rtl', page.locator(headerSelector)) | ||
}) | ||
|
||
test('searchbar hovered', async ({ page }) => { | ||
await page.hover('input') | ||
await hideInputCursors(page) | ||
await expectSnapshot( | ||
'searchbar-hovered-rtl', | ||
page.locator(headerSelector) | ||
) | ||
}) | ||
}) | ||
}) | ||
}) | ||
}) |
Binary file added
BIN
+7.05 KB
...playwright/visual-regression/header.spec.ts-snapshots/resting-ltr-2xl-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.91 KB
.../playwright/visual-regression/header.spec.ts-snapshots/resting-ltr-lg-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.96 KB
.../playwright/visual-regression/header.spec.ts-snapshots/resting-ltr-md-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.59 KB
.../playwright/visual-regression/header.spec.ts-snapshots/resting-ltr-sm-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.04 KB
.../playwright/visual-regression/header.spec.ts-snapshots/resting-ltr-xl-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.46 KB
.../playwright/visual-regression/header.spec.ts-snapshots/resting-ltr-xs-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.33 KB
...playwright/visual-regression/header.spec.ts-snapshots/resting-rtl-2xl-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.14 KB
.../playwright/visual-regression/header.spec.ts-snapshots/resting-rtl-lg-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.17 KB
.../playwright/visual-regression/header.spec.ts-snapshots/resting-rtl-md-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.59 KB
.../playwright/visual-regression/header.spec.ts-snapshots/resting-rtl-sm-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.3 KB
.../playwright/visual-regression/header.spec.ts-snapshots/resting-rtl-xl-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.44 KB
.../playwright/visual-regression/header.spec.ts-snapshots/resting-rtl-xs-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.79 KB
...laywright/visual-regression/header.spec.ts-snapshots/scrolled-ltr-2xl-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.64 KB
...playwright/visual-regression/header.spec.ts-snapshots/scrolled-ltr-lg-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.71 KB
...playwright/visual-regression/header.spec.ts-snapshots/scrolled-ltr-md-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.67 KB
...playwright/visual-regression/header.spec.ts-snapshots/scrolled-ltr-sm-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.79 KB
...playwright/visual-regression/header.spec.ts-snapshots/scrolled-ltr-xl-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.21 KB
...playwright/visual-regression/header.spec.ts-snapshots/scrolled-ltr-xs-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.03 KB
...laywright/visual-regression/header.spec.ts-snapshots/scrolled-rtl-2xl-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.88 KB
...playwright/visual-regression/header.spec.ts-snapshots/scrolled-rtl-lg-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.95 KB
...playwright/visual-regression/header.spec.ts-snapshots/scrolled-rtl-md-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.66 KB
...playwright/visual-regression/header.spec.ts-snapshots/scrolled-rtl-sm-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.04 KB
...playwright/visual-regression/header.spec.ts-snapshots/scrolled-rtl-xl-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.2 KB
...playwright/visual-regression/header.spec.ts-snapshots/scrolled-rtl-xs-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.14 KB
.../visual-regression/header.spec.ts-snapshots/searchbar-hovered-ltr-2xl-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.99 KB
...t/visual-regression/header.spec.ts-snapshots/searchbar-hovered-ltr-lg-linux.png
Oops, something went wrong.
Binary file added
BIN
+5.04 KB
...t/visual-regression/header.spec.ts-snapshots/searchbar-hovered-ltr-md-linux.png
Oops, something went wrong.
Binary file added
BIN
+5.62 KB
...t/visual-regression/header.spec.ts-snapshots/searchbar-hovered-ltr-sm-linux.png
Oops, something went wrong.
Binary file added
BIN
+7.17 KB
...t/visual-regression/header.spec.ts-snapshots/searchbar-hovered-ltr-xl-linux.png
Oops, something went wrong.
Binary file added
BIN
+5.49 KB
...t/visual-regression/header.spec.ts-snapshots/searchbar-hovered-ltr-xs-linux.png
Oops, something went wrong.
Binary file added
BIN
+7.47 KB
.../visual-regression/header.spec.ts-snapshots/searchbar-hovered-rtl-2xl-linux.png
Oops, something went wrong.
Binary file added
BIN
+7.31 KB
...t/visual-regression/header.spec.ts-snapshots/searchbar-hovered-rtl-lg-linux.png
Oops, something went wrong.
Binary file added
BIN
+5.28 KB
...t/visual-regression/header.spec.ts-snapshots/searchbar-hovered-rtl-md-linux.png
Oops, something went wrong.
Binary file added
BIN
+5.64 KB
...t/visual-regression/header.spec.ts-snapshots/searchbar-hovered-rtl-sm-linux.png
Oops, something went wrong.
Binary file added
BIN
+7.48 KB
...t/visual-regression/header.spec.ts-snapshots/searchbar-hovered-rtl-xl-linux.png
Oops, something went wrong.
Binary file added
BIN
+5.49 KB
...t/visual-regression/header.spec.ts-snapshots/searchbar-hovered-rtl-xs-linux.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,10 @@ const tapeNameGenerator = (tapeNumber, tape) => { | |
if (typeMatch && typeMatch.type) { | ||
const groups = typeMatch.match.groups | ||
const prefix = `${typeMatch.type}_${groups.mediaType}` | ||
const suffix = tape.req.headers.connection | ||
let suffix = `${tape.req.headers.connection}` | ||
if (tape.req.method !== 'GET') { | ||
suffix = `${suffix}_${tape.req.method}` | ||
} | ||
Comment on lines
+54
to
+57
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice addition 💯 |
||
if (typeMatch.type === 'search') { | ||
return `${prefix}_${groups.query}_${suffix}` | ||
} else { | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Background color is already applied on hover by
group-hover:bg-dark-charcoal-06
class.