v1.12.24 멤버 작성 이력 통합 표 및 종류 필터 추가

This commit is contained in:
2026-10-21 17:03:07 +09:00
parent 7c95797fd2
commit 93dc6c04bd
13 changed files with 229 additions and 73 deletions

View File

@@ -1,7 +1,7 @@
import { expect, test } from '@playwright/test'
import postgres from 'postgres'
test('멤버 댓글 페이지 이동·게시물 링크와 대시보드 최근 댓글을 표시한다', async ({ page }) => {
test('멤버 통합 작성 이력의 종류 필터·검색·페이지와 대시보드 댓글을 표시한다', async ({ page }) => {
const database = postgres(process.env.DATABASE_URL, { max: 1 })
let postId
try {
@@ -24,28 +24,36 @@ test('멤버 댓글 페이지 이동·게시물 링크와 대시보드 최근
await page.goto(`/admin/members/${admin.userId}`)
await page.waitForLoadState('networkidle')
await expect(page.locator('.admin-member-activity')).toHaveCount(0)
await page.getByRole('button', { name: '작성한 댓글', exact: true }).click()
const list = page.locator('.admin-member-activity')
await expect(list.locator('.admin-member-activity__item')).toHaveCount(10)
await expect(list.locator('.admin-member-activity__body').first()).toHaveText('화면 댓글 10')
await expect(list.getByRole('link', { name: '게시물 보기' }).first()).toHaveAttribute('href', '/post/comments-ui-test#comments')
await list.getByRole('button', { name: '다음 페이지' }).click()
await expect(list.locator('.admin-member-activity__item')).toHaveCount(1)
await expect(list.locator('.admin-member-activity__body')).toHaveText('화면 댓글 0')
await list.getByRole('button', { name: '이전 페이지' }).click()
await expect(list.locator('.admin-member-activity__item')).toHaveCount(10)
await list.getByLabel('작성한 댓글 검색').fill('화면 댓글 0')
await list.getByRole('button', { name: '검색', exact: true }).click()
await expect(list.locator('.admin-member-activity__item')).toHaveCount(1)
await expect(list.locator('.admin-member-activity__body')).toHaveText('화면 댓글 0')
await list.getByLabel('작성한 댓글 검색').fill('결과없음')
await list.getByRole('button', { name: '검색', exact: true }).click()
await expect(list).toContainText('검색 결과가 없습니다.')
await expect(page.getByRole('button', { name: '작성한 댓글', exact: true })).toHaveCount(0)
await page.getByRole('button', { name: '작성한 글', exact: true }).click()
await expect(page.locator('.admin-member-activity__item')).toHaveCount(1)
await page.getByLabel('작성한 글 검색').fill('없는글')
await page.locator('.admin-member-activity').getByRole('button', { name: '검색', exact: true }).click()
await expect(page.locator('.admin-member-activity')).toContainText('검색 결과가 없습니다.')
const list = page.locator('.admin-member-activity')
const items = list.locator('.admin-member-activity__item')
await expect(items).toHaveCount(10)
await expect(list.locator('.admin-member-activity__body').first()).toHaveText('화면 댓글 10')
await expect(list.locator('.admin-member-activity__post').first()).toHaveAttribute('href', '/post/comments-ui-test#comments')
await list.getByRole('button', { name: '다음 페이지' }).click()
await expect(items).toHaveCount(2)
await expect(list.locator('.admin-member-activity__kind')).toHaveText(['댓글', '게시글'])
await list.getByLabel('작성 종류').selectOption('comment')
await expect(items).toHaveCount(10)
await expect(list.locator('.admin-member-activity__kind').first()).toHaveText('댓글')
await list.getByRole('button', { name: '다음 페이지' }).click()
await expect(items).toHaveCount(1)
await list.getByLabel('작성한 글 검색').fill('화면 댓글 0')
await list.getByRole('button', { name: '검색', exact: true }).click()
await expect(items).toHaveCount(1)
await expect(list.locator('.admin-member-activity__body')).toHaveText('화면 댓글 0')
await list.getByLabel('작성 종류').selectOption('post')
await expect(list).toContainText('검색 결과가 없습니다.')
await list.getByLabel('작성한 글 검색').fill('')
await list.getByRole('button', { name: '검색', exact: true }).click()
await expect(items).toHaveCount(1)
await expect(list.locator('.admin-member-activity__kind')).toHaveText('게시글')
await expect(list.locator('.admin-member-activity__body')).toHaveText('본문')
await list.getByLabel('작성 종류').selectOption('all')
await expect(items).toHaveCount(10)
const rowBox = await items.first().boundingBox()
expect(rowBox.height).toBeLessThan(40)
await page.getByRole('button', { name: '정보', exact: true }).click()
await expect(page.locator('.admin-member-form__body')).toBeVisible()
await page.goto('/admin')