Skip to content

Commit

Permalink
test: header-links icons should be unique (#777)
Browse files Browse the repository at this point in the history
Co-authored-by: Noam Gaash <noam.gaash@gmail.com>
  • Loading branch information
dorinzrihen and NoamGaash authored Jun 14, 2024
1 parent 84a9704 commit 32fbd70
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/mainHeader.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { test, expect } from './utils'

test.beforeEach(async ({ page }) => {
await page.goto('/')
})

test("the main header doesn't show duplicate icons", async ({ page }) => {
const headerLocator = page.locator('div.header-links')
const svgLocators = headerLocator.locator('svg')
const svgCount = await svgLocators.count()
const svgInnerHTML = []
for (let i = 0; i < svgCount; i++) {
const innerHTML = await svgLocators.nth(i).innerHTML()
svgInnerHTML.push(innerHTML)
}
const svgCountWithoutDuplicates = new Set(svgInnerHTML).size
expect(svgCountWithoutDuplicates).toBe(svgCount)
})

0 comments on commit 32fbd70

Please sign in to comment.