@@ -136,4 +136,118 @@ test.describe("필터 다이얼로그", () => {
136136 const allRowCount = await page . locator ( "table tbody tr" ) . count ( ) ;
137137 expect ( allRowCount ) . toBeGreaterThan ( filteredRowCount ) ;
138138 } ) ;
139+
140+ test ( "관문 분리하기 선택 시 레이드가 관문별로 분리됨" , async ( { page } ) => {
141+ // 합쳐보기 상태에서 베히모스 행 확인
142+ const mergedRow = page
143+ . locator ( "table tbody tr" )
144+ . filter ( { hasText : "[노말]폭풍의 지휘관, 베히모스" } ) ;
145+ await expect ( mergedRow ) . toHaveCount ( 1 ) ;
146+ await expect ( mergedRow ) . not . toContainText ( "관문" ) ;
147+
148+ // 필터 다이얼로그 열기 및 분리하기 선택 (라벨 클릭)
149+ await page . getByRole ( "button" , { name : "필터" } ) . click ( ) ;
150+ const dialog = page . getByRole ( "dialog" ) ;
151+ await dialog . locator ( "label" ) . filter ( { hasText : "분리하기" } ) . click ( ) ;
152+ await dialog . getByRole ( "button" , { name : "close" } ) . click ( ) ;
153+
154+ // 분리된 관문별 행 확인
155+ const gate1Row = page
156+ . locator ( "table tbody tr" )
157+ . filter ( { hasText : "[노말]폭풍의 지휘관, 베히모스 1관문" } ) ;
158+ const gate2Row = page
159+ . locator ( "table tbody tr" )
160+ . filter ( { hasText : "[노말]폭풍의 지휘관, 베히모스 2관문" } ) ;
161+
162+ await expect ( gate1Row ) . toHaveCount ( 1 ) ;
163+ await expect ( gate2Row ) . toHaveCount ( 1 ) ;
164+ } ) ;
165+
166+ test ( "관문 합쳐보기 선택 시 레이드가 합쳐서 표시됨" , async ( { page } ) => {
167+ // 먼저 분리하기로 변경 (라벨 클릭)
168+ await page . getByRole ( "button" , { name : "필터" } ) . click ( ) ;
169+ const dialog = page . getByRole ( "dialog" ) ;
170+ await dialog . locator ( "label" ) . filter ( { hasText : "분리하기" } ) . click ( ) ;
171+ await dialog . getByRole ( "button" , { name : "close" } ) . click ( ) ;
172+
173+ // 분리된 상태 확인
174+ const gate1Row = page
175+ . locator ( "table tbody tr" )
176+ . filter ( { hasText : "[노말]폭풍의 지휘관, 베히모스 1관문" } ) ;
177+ await expect ( gate1Row ) . toHaveCount ( 1 ) ;
178+
179+ // 다시 합쳐보기로 변경 (라벨 클릭)
180+ await page . getByRole ( "button" , { name : "필터" } ) . click ( ) ;
181+ await dialog . locator ( "label" ) . filter ( { hasText : / ^ 합 쳐 보 기 $ / } ) . click ( ) ;
182+ await dialog . getByRole ( "button" , { name : "close" } ) . click ( ) ;
183+
184+ // 합쳐진 상태 확인
185+ const mergedRow = page
186+ . locator ( "table tbody tr" )
187+ . filter ( { hasText : "[노말]폭풍의 지휘관, 베히모스" } ) ;
188+ await expect ( mergedRow ) . toHaveCount ( 1 ) ;
189+ await expect ( mergedRow ) . not . toContainText ( "관문" ) ;
190+ } ) ;
191+
192+ test ( "더보기 포함 여부 라디오 버튼 변경이 동작함" , async ( { page } ) => {
193+ await page . getByRole ( "button" , { name : "필터" } ) . click ( ) ;
194+ const dialog = page . getByRole ( "dialog" ) ;
195+
196+ // 기본값 확인: 미포함 선택됨
197+ const seeMoreGroup = dialog
198+ . getByRole ( "group" )
199+ . filter ( { hasText : "더보기 포함 여부" } ) ;
200+ const excludeRadio = seeMoreGroup . getByRole ( "radio" , {
201+ name : "미포함" ,
202+ exact : true ,
203+ } ) ;
204+ const includeRadio = seeMoreGroup . getByRole ( "radio" , {
205+ name : "포함" ,
206+ exact : true ,
207+ } ) ;
208+
209+ await expect ( excludeRadio ) . toBeChecked ( ) ;
210+ await expect ( includeRadio ) . not . toBeChecked ( ) ;
211+
212+ // 포함으로 변경 (라벨 클릭)
213+ await seeMoreGroup . locator ( "label" ) . filter ( { hasText : / ^ 포 함 $ / } ) . click ( ) ;
214+ await expect ( includeRadio ) . toBeChecked ( ) ;
215+ await expect ( excludeRadio ) . not . toBeChecked ( ) ;
216+
217+ // 다시 미포함으로 변경
218+ await seeMoreGroup . locator ( "label" ) . filter ( { hasText : "미포함" } ) . click ( ) ;
219+ await expect ( excludeRadio ) . toBeChecked ( ) ;
220+ await expect ( includeRadio ) . not . toBeChecked ( ) ;
221+ } ) ;
222+
223+ test ( "귀속 재료 포함 여부 라디오 버튼 변경이 동작함" , async ( { page } ) => {
224+ await page . getByRole ( "button" , { name : "필터" } ) . click ( ) ;
225+ const dialog = page . getByRole ( "dialog" ) ;
226+
227+ // 기본값 확인: 미포함 선택됨
228+ const boundGroup = dialog
229+ . getByRole ( "group" )
230+ . filter ( { hasText : "귀속 재료 포함 여부" } ) ;
231+ const excludeRadio = boundGroup . getByRole ( "radio" , {
232+ name : "미포함" ,
233+ exact : true ,
234+ } ) ;
235+ const includeRadio = boundGroup . getByRole ( "radio" , {
236+ name : "포함" ,
237+ exact : true ,
238+ } ) ;
239+
240+ await expect ( excludeRadio ) . toBeChecked ( ) ;
241+ await expect ( includeRadio ) . not . toBeChecked ( ) ;
242+
243+ // 포함으로 변경 (라벨 클릭)
244+ await boundGroup . locator ( "label" ) . filter ( { hasText : / ^ 포 함 $ / } ) . click ( ) ;
245+ await expect ( includeRadio ) . toBeChecked ( ) ;
246+ await expect ( excludeRadio ) . not . toBeChecked ( ) ;
247+
248+ // 다시 미포함으로 변경
249+ await boundGroup . locator ( "label" ) . filter ( { hasText : "미포함" } ) . click ( ) ;
250+ await expect ( excludeRadio ) . toBeChecked ( ) ;
251+ await expect ( includeRadio ) . not . toBeChecked ( ) ;
252+ } ) ;
139253} ) ;
0 commit comments