Skip to content

Commit

Permalink
fix test for <button>
Browse files Browse the repository at this point in the history
  • Loading branch information
D4ve-R committed Nov 22, 2024
1 parent ad9fad3 commit 547e732
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/links.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ test.describe('disabled attribute', () => {

test('disables the link (as=button) when the disabled attribute is set to true', async ({ page }) => {
await page.goto('/links/disabled')
const link = await page.getByRole('link', { name: 'Disabled Button', exact: true })
const link = await page.getByRole('button', { name: 'Disabled Button', exact: true })
await expect(link).toBeDisabled()
await expect(link).toHaveAttribute('disabled', 'true')
await link.click()
Expand All @@ -799,7 +799,7 @@ test.describe('disabled attribute', () => {

test('disables the link (as=button) when the disabled attribute is set', async ({ page }) => {
await page.goto('/links/disabled')
const link = await page.getByRole('link', { name: 'Disabled Default Button', exact: true })
const link = await page.getByRole('button', { name: 'Disabled Default Button', exact: true })
await expect(link).toBeDisabled()
await expect(link).toHaveAttribute('disabled')
await link.click()
Expand All @@ -808,7 +808,7 @@ test.describe('disabled attribute', () => {

test('does not disable the link (as=button) when the disabled attribute is set to false', async ({ page }) => {
await page.goto('/links/disabled')
const link = await page.getByRole('link', { name: 'Enabled Button', exact: true })
const link = await page.getByRole('button', { name: 'Enabled Button', exact: true })
await expect(link).not.toBeDisabled()
await expect(link).toHaveAttribute('disabled', 'false')
await link.click()
Expand All @@ -817,7 +817,7 @@ test.describe('disabled attribute', () => {

test('does not disable the link (as=button) when the disabled attribute is not set', async ({ page }) => {
await page.goto('/links/disabled')
const link = await page.getByRole('link', { name: 'Enabled Default Button', exact: true })
const link = await page.getByRole('button', { name: 'Enabled Default Button', exact: true })
await expect(link).not.toBeDisabled()
await expect(link).not.toHaveAttribute('disabled')
await link.click()
Expand Down

0 comments on commit 547e732

Please sign in to comment.