Skip to content

Commit

Permalink
Merge branch 'main' into bs/fix-underlinenav-default-story
Browse files Browse the repository at this point in the history
  • Loading branch information
broccolinisoup committed Oct 8, 2023
2 parents 1d13dce + ae23932 commit db29b39
Show file tree
Hide file tree
Showing 36 changed files with 502 additions and 388 deletions.
7 changes: 7 additions & 0 deletions .changeset/happy-rivers-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@primer/react": minor
---

Updates link styles to support underline link preferences.

<!-- Changed components: ActionList, BranchName, Breadcrumbs, Button, Button2, Heading, Link -->
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.
14 changes: 14 additions & 0 deletions e2e/components/BranchName.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,19 @@ test.describe('BranchName', () => {
})
})
}

test.describe('with forced underlines', () => {
test('default @vrt', async ({page}) => {
await visit(page, {
id: 'components-branchname--default',
globals: {
colorScheme: 'light',
prefersLinkUnderlines: 'true',
},
})

expect(await page.screenshot()).toMatchSnapshot('BranchName.Default.light.forcedUnderlines.png')
})
})
})
})
14 changes: 14 additions & 0 deletions e2e/components/Breadcrumbs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,19 @@ test.describe('Breadcrumbs', () => {
})
})
}

test.describe('with forced underlines', () => {
test('default @vrt', async ({page}) => {
await visit(page, {
id: 'components-breadcrumbs--default',
globals: {
colorScheme: 'light',
prefersLinkUnderlines: 'true',
},
})

expect(await page.screenshot()).toMatchSnapshot('Breadcrumbs.Default.light.forcedUnderlines.png')
})
})
})
})
42 changes: 42 additions & 0 deletions e2e/components/Link.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,20 @@ test.describe('Link', () => {
})
})
}

test.describe('with forced underlines', () => {
test('default @vrt', async ({page}) => {
await visit(page, {
id: 'components-link--default',
globals: {
colorScheme: 'light',
prefersLinkUnderlines: 'true',
},
})

expect(await page.screenshot()).toMatchSnapshot('Link.Default.light.forcedUnderlines.png')
})
})
})

test.describe('Muted', () => {
Expand Down Expand Up @@ -85,6 +99,20 @@ test.describe('Link', () => {
})
})
}

test.describe('with forced underlines', () => {
test('default @vrt', async ({page}) => {
await visit(page, {
id: 'components-link-features--muted',
globals: {
colorScheme: 'light',
prefersLinkUnderlines: 'true',
},
})

expect(await page.screenshot()).toMatchSnapshot('Link.Muted.light.forcedUnderlines.png')
})
})
})

test.describe('Underline', () => {
Expand Down Expand Up @@ -127,5 +155,19 @@ test.describe('Link', () => {
})
})
}

test.describe('with forced underlines', () => {
test('default @vrt', async ({page}) => {
await visit(page, {
id: 'components-link-features--underline',
globals: {
colorScheme: 'light',
prefersLinkUnderlines: 'true',
},
})

expect(await page.screenshot()).toMatchSnapshot('Link.Underline.light.forcedUnderlines.png')
})
})
})
})
14 changes: 14 additions & 0 deletions e2e/components/LinkButton.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,20 @@ test.describe('LinkButton', () => {
})
})
}

test.describe('with forced underlines', () => {
test('default @vrt', async ({page}) => {
await visit(page, {
id: 'components-linkbutton-features--invisible',
globals: {
colorScheme: 'light',
prefersLinkUnderlines: 'true',
},
})

expect(await page.screenshot()).toMatchSnapshot('LinkButton.Invisible.light.forcedUnderlines.png')
})
})
})

test.describe('Large', () => {
Expand Down
2 changes: 1 addition & 1 deletion e2e/test-helpers/storybook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export async function visit(page: Page, options: Options) {
let params = ''
for (const [key, value] of Object.entries(globals)) {
if (params !== '') {
params += '&'
params += ';'
}
params += `${key}:${value}`
}
Expand Down
Loading

0 comments on commit db29b39

Please sign in to comment.