Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,3 @@ function MyComponent() {
- `data-ouia-component-id?: string` - Testing identifier

**Note:** Must be used within insights-chrome environment. The component uses `chrome.drawerActions.toggleDrawerContent()` to open the help panel.


25 changes: 16 additions & 9 deletions playwright/help-panel-learn-tab.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ test.describe('help panel - Learn tab', () => {
const contentTypeToggle = page.getByRole('button', { name: /content type/i });
await contentTypeToggle.click();

// Select "Documentation" filter - scope to the Select menu
await page.locator('[data-ouia-component-id="help-panel-content-type-select"]').getByText('Documentation', { exact: true }).click();
// Select "Documentation" filter - must click the checkbox input, not the text
const documentationCheckbox = page.locator('[data-ouia-component-id="help-panel-content-type-option-documentation"] input[type="checkbox"]');
await documentationCheckbox.click();

// Wait for state update and filtering
await page.waitForTimeout(1000);
// Wait for filter chip to appear
await expect(page.locator('[data-ouia-component-id="help-panel-selected-chip-documentation"]')).toBeVisible();

// Verify count has changed (should be less than or equal to initial) - this confirms filter is applied
await expect(async () => {
Expand All @@ -74,16 +75,22 @@ test.describe('help panel - Learn tab', () => {
const contentTypeToggle = page.getByRole('button', { name: /content type/i });
await contentTypeToggle.click();

// Select Quick starts
await page.locator('[data-ouia-component-id="help-panel-content-type-select"]').getByText('Quick starts', { exact: true }).click();
await page.waitForTimeout(500);
// Select Quick starts - must click the checkbox input, not the text
const quickstartCheckbox = page.locator('[data-ouia-component-id="help-panel-content-type-option-quickstart"] input[type="checkbox"]');
await quickstartCheckbox.click();

// Wait for filter chip to appear
await expect(page.locator('[data-ouia-component-id="help-panel-selected-chip-quickstart"]')).toBeVisible();

// Verify toggle button shows selection count of 1
await expect(contentTypeToggle).toContainText('1');

// Select another filter - Learning paths
await page.locator('[data-ouia-component-id="help-panel-content-type-select"]').getByText('Learning paths', { exact: true }).click();
await page.waitForTimeout(500);
const learningPathCheckbox = page.locator('[data-ouia-component-id="help-panel-content-type-option-learningPath"] input[type="checkbox"]');
await learningPathCheckbox.click();

// Wait for filter chip to appear
await expect(page.locator('[data-ouia-component-id="help-panel-selected-chip-learningPath"]')).toBeVisible();

// Verify toggle button shows selection count of 2
await expect(contentTypeToggle).toContainText('2');
Expand Down
Loading