Skip to content

Commit

Permalink
fixed failing e2e tests due to tabs out of view
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonMilord committed Jan 14, 2025
1 parent c0bd94b commit 7d8ac14
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ export class TabBarObject {
return this.page.locator('c-quantic-tab-bar');
}

get allTabs(): Locator {
return this.tabBar.locator('c-quantic-tab');
}

get allVisibleTabs(): Locator {
return this.tabBar.locator('c-quantic-tab').filter({
has: this.page.locator(':visible'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ useCaseTestCases.forEach((useCase) => {
test('should display all the tabs without displaying the dropdown list', async ({
tabBar,
}) => {
const tabBarElement = tabBar.tabBar;
await tabBarElement.scrollIntoViewIfNeeded();
const tabs = tabBar.allVisibleTabs;

expect(tabs).not.toBeNull();
expect(await tabs.count()).toEqual(expectedNumberOfTabs);

Expand All @@ -71,13 +72,16 @@ useCaseTestCases.forEach((useCase) => {
viewport: {width: viewportWidth, height: standardViewportHeight},
});
test(testLabel, async ({tabBar}) => {
const dropdownContainer = tabBar.dropdownContainer;
await dropdownContainer.scrollIntoViewIfNeeded();

const displayedTabs = tabBar.allVisibleTabs;
expect(displayedTabs).not.toBeNull();
expect(await displayedTabs.count()).toEqual(
expectedNumberOfTabsDisplayed
);

expect(await tabBar.dropdownContainer.isVisible()).toBe(true);
expect(await dropdownContainer.isVisible()).toBe(true);

await tabBar.clickMoreButton();

Expand Down

0 comments on commit 7d8ac14

Please sign in to comment.