Skip to content

Commit

Permalink
Merge pull request #9061 from weseek/imprv/148538-collapse-sidebar
Browse files Browse the repository at this point in the history
imprv: CollapseSidebar (Playwright util)
  • Loading branch information
miya authored Sep 4, 2024
2 parents d31ee19 + 2cc04fe commit c7ebe31
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/reusable-app-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ jobs:
fail-fast: false
matrix:
# List string expressions that is comma separated ids of tests in "test/cypress/integration"
spec-group: ['21', '50']
spec-group: ['50']

services:
mongodb:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ test('Access to /trash page', async({ page }) => {
await expect(page.getByTestId('trash-page-list')).toBeVisible();
});

// TODO: Improve collapseSidebar (https://redmine.weseek.co.jp/issues/148538)
// test('Access to /tags page', async({ page }) => {
// await page.goto('/tags');

// await collapseSidebar(page, false);
// await page.getByTestId('grw-sidebar-nav-primary-tags').click();
// await expect(page.getByTestId('grw-sidebar-content-tags')).toBeVisible();
// await expect(page.getByTestId('grw-tags-list').first()).toBeVisible();
// await expect(page.getByTestId('grw-tags-list').first()).toContainText('You have no tag, You can set tags on pages');
// await expect(page.getByTestId('tags-page')).toBeVisible();
// });
test('Access to /tags page', async({ page }) => {
await page.goto('/');

await collapseSidebar(page, false);
await page.getByTestId('grw-sidebar-nav-primary-tags').click();
await expect(page.getByTestId('grw-sidebar-content-tags')).toBeVisible();
await expect(page.getByTestId('grw-tags-list').first()).toBeVisible();
await expect(page.getByTestId('grw-tags-list').first()).toContainText('You have no tag, You can set tags on pages');

await page.getByTestId('check-all-tags-button').click();
await expect(page.getByTestId('tags-page')).toBeVisible();
});
2 changes: 0 additions & 2 deletions apps/app/playwright/utils/CollapseSidebar.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// TODO: https://redmine.weseek.co.jp/issues/148538
import { expect, type Page } from '@playwright/test';

export const collapseSidebar = async(page: Page, isCollapsed: boolean): Promise<void> => {
Expand All @@ -9,7 +8,6 @@ export const collapseSidebar = async(page: Page, isCollapsed: boolean): Promise<

const collapseSidebarToggle = page.getByTestId('btn-toggle-collapse');
await expect(collapseSidebarToggle).toBeVisible();

await collapseSidebarToggle.click();

if (isCollapsed) {
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/client/components/Sidebar/Tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const Tag: FC = () => {
)
}

<div className="d-flex justify-content-center my-5">
<div className="d-flex justify-content-center my-5" data-testid="check-all-tags-button">
<Link
href="/tags"
className="btn btn-primary rounded px-4"
Expand Down

This file was deleted.

0 comments on commit c7ebe31

Please sign in to comment.