diff --git a/src/tab/Tab.spec.ts b/src/tab/Tab.spec.ts index ac4ab3ff..b782d2c0 100644 --- a/src/tab/Tab.spec.ts +++ b/src/tab/Tab.spec.ts @@ -5,17 +5,17 @@ test(`Tab - Basic Behaviour`, async ({ page }) => { await page.goto('/components/tab/'); await page.waitForSelector('[data-testid]', {}); - // For the purposes of the demo the Tabs are slotted in a Tab Group + // For the purposes of the demo the Tabs are slotted in a Tab Group. const tabGroup = page.locator('.Basic').getByTestId('test-tab-group'); await expect(tabGroup).toHaveScreenshot('tab-group-initial.png'); // Get the Tab bar which will contain the tab headers. const tabBar = tabGroup.locator('.tab-bar').first(); - // Get all the tab headers + // Get all the tab headers. const nestedTabHeaders = tabBar.locator('omni-tab-header'); await expect(nestedTabHeaders).toHaveCount(3); - // Get all the omni-tabs + // Get all the omni-tabs. const tabs = tabGroup.locator('omni-tab'); await expect(tabs).toHaveCount(3); }); @@ -26,7 +26,7 @@ test(`Tab - Active Behaviour`, async ({ page }) => { await page.goto('/components/tab/'); await page.waitForSelector('[data-testid]', {}); - // For the purposes of the demo the Tabs are slotted in a Tab Group + // For the purposes of the demo the Tabs are slotted in a Tab Group. const tabGroup = page.locator('.Active').getByTestId('test-tab-group'); await expect(tabGroup).toHaveScreenshot('tab-group-initial.png'); // Get the Tab bar which will contain the tab headers. @@ -34,11 +34,11 @@ test(`Tab - Active Behaviour`, async ({ page }) => { // Mock tab-select event. const tabSelect = await mockEventListener(tabGroup, 'tab-select'); - // Get all the tab headers + // Get all the tab headers. const nestedTabHeaders = tabBar.locator('omni-tab-header'); await expect(nestedTabHeaders).toHaveCount(3); - // Get all the omni-tabs + // Get all the omni-tabs. const tabs = tabGroup.locator('omni-tab'); await expect(tabs).toHaveCount(3); @@ -66,10 +66,8 @@ test(`Tab - Disabled Behaviour`, async ({ page }) => { await withCoverage(page, async () => { await page.goto('/components/tab/'); await page.waitForSelector('[data-testid]', {}); - // Locate the Disabled Tab example. const tabGroup = page.locator('.Disabled').getByTestId('test-tab-group'); await expect(tabGroup).toHaveScreenshot('tab-group-initial.png'); - // Mock tab-select event. const tabSelect = await mockEventListener(tabGroup, 'tab-select'); @@ -80,10 +78,9 @@ test(`Tab - Disabled Behaviour`, async ({ page }) => { const nestedTabHeaders = tabBar.locator('omni-tab-header'); await expect(nestedTabHeaders).toHaveCount(3); - // Get default slot. + // Get default slot const tabs = tabGroup.locator('omni-tab'); await expect(tabs).toHaveCount(3); - // Click the disabled tab twice. await nestedTabHeaders.nth(2).click(); await nestedTabHeaders.nth(2).click(); diff --git a/src/tab/TabGroup.spec.ts b/src/tab/TabGroup.spec.ts index 306b5299..36b27b4a 100644 --- a/src/tab/TabGroup.spec.ts +++ b/src/tab/TabGroup.spec.ts @@ -3,7 +3,7 @@ import { test, expect, mockEventListener, withCoverage } from '../utils/JestPlay test(`Tab Group - Visual and Behaviour`, async ({ page }) => { await withCoverage(page, async () => { await page.goto('/components/tab-group/'); - // Locate the interactive Tab Group example + const tabGroup = page.locator('.Interactive').getByTestId('test-tab-group'); await expect(tabGroup).toHaveScreenshot('tab-group-initial.png'); // Mock tab-select event. @@ -12,11 +12,11 @@ test(`Tab Group - Visual and Behaviour`, async ({ page }) => { const tabBar = tabGroup.locator('.tab-bar'); await expect(tabBar).toHaveCount(1); - // Get all the omni-tab-headers + // Get all the omni-tab-headers. const nestedTabHeaders = tabBar.locator('omni-tab-header'); await expect(nestedTabHeaders).toHaveCount(3); - // Get all the omni-tabs + // Get all the omni-tabs. const tabs = tabGroup.locator('omni-tab'); await expect(tabs).toHaveCount(3); diff --git a/src/tab/TabHeader.spec.ts b/src/tab/TabHeader.spec.ts index b14fbabe..9e3ab3d5 100644 --- a/src/tab/TabHeader.spec.ts +++ b/src/tab/TabHeader.spec.ts @@ -3,33 +3,33 @@ import { test, expect, mockEventListener, withCoverage } from '../utils/JestPlay test(`Tab Header - Advanced Behaviour`, async ({ page }) => { await withCoverage(page, async () => { await page.goto('/components/tab-header/'); - // Locate the Advanced Tab Header example. + const tabGroup = page.locator('.Advanced').getByTestId('test-tab-group'); await expect(tabGroup).toHaveScreenshot('tab-group-initial.png'); // Mock tab-select event. const tabSelect = await mockEventListener(tabGroup, 'tab-select'); - // Get all the tab headers + // Get all the tab headers. const nestedTabHeaders = tabGroup.locator('omni-tab-header'); await expect(nestedTabHeaders).toHaveCount(4); - // Get all the omni-tabs + // Get all the omni-tabs. const tabs = tabGroup.locator('omni-tab'); await expect(tabs).toHaveCount(4); - // Get the active tab header + // Get the active tab header. const activeTabHeader = tabGroup.locator('omni-tab-header[data-active]'); await expect(activeTabHeader).toHaveCount(1); - // Get the omni-icon in the tab header slot + // Get the omni-icon in the tab header slot. const omniIcon = activeTabHeader.locator('omni-icon'); await expect(omniIcon).toHaveCount(1); - // Get the third tab header + // Get the third tab header. const thirdTabHeader = nestedTabHeaders.nth(2); - // Get the omni-icon of the third tab header + // Get the omni-icon of the third tab header. const thirdTabHeaderIcon = thirdTabHeader.locator('omni-icon'); // Get the SVG slotted in the omni-icon component. const svg = thirdTabHeaderIcon.locator('svg');