Skip to content

Commit dc5406b

Browse files
committed
refactor: 테스트 오작동 관련 문제 해결
1 parent 6d545f3 commit dc5406b

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

cypress/e2e/main.cy.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('메인 페이지', () => {
1616
cy.contains('전체 좋아요 수').should('be.visible');
1717
cy.contains('총 게시글 수').should('be.visible');
1818

19-
cy.contains('2500').should('be.visible');
19+
cy.contains('2,500').should('be.visible');
2020
cy.contains('350').should('be.visible');
2121
cy.contains('15').should('be.visible');
2222
});
@@ -25,20 +25,26 @@ describe('메인 페이지', () => {
2525
cy.contains('테스트 게시물 1').should('be.visible');
2626
cy.contains('테스트 게시물 2').should('be.visible');
2727

28-
cy.contains('150').should('be.visible');
29-
cy.contains('25').should('be.visible');
28+
cy.get('section').should('contain.text', '150');
29+
cy.get('section').should('contain.text', '25');
30+
cy.get('section').should('contain.text', '200');
31+
cy.get('section').should('contain.text', '35');
3032
});
3133

3234
it('정렬 및 필터 기능이 동작해야 한다', () => {
33-
cy.get('select').should('be.visible');
34-
cy.get('input[type="checkbox"]').should('be.visible');
35+
cy.get('button').should('exist');
36+
37+
cy.get('input[type="checkbox"]').should('exist');
38+
cy.contains('오름차순').should('be.visible');
39+
3540
cy.contains('새로고침').should('be.visible');
3641
cy.contains('새로고침').should('be.disabled');
3742
});
3843

3944
it('마지막 업데이트 시간이 표시되어야 한다', () => {
40-
cy.contains('마지막 업데이트').should('be.visible');
41-
cy.contains(/\d{4}-\d{2}-\d{2}/).should('be.visible');
45+
cy.contains('마지막 업데이트').should('exist');
46+
47+
cy.get('body').should('contain.text', '2025');
4248
});
4349

4450
it('로그아웃 기능이 동작해야 한다', () => {

0 commit comments

Comments
 (0)