-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of https://github.com/Moaguide-develop/moaguide_front
- Loading branch information
Showing
50 changed files
with
872 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,4 +37,4 @@ next-env.d.ts | |
.env | ||
# Sentry Config File | ||
.env.sentry-build-plugin | ||
todo | ||
todo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export function logintest() { | ||
cy.visit('/sign'); | ||
cy.get('input[type="email"]').type('moaguide1'); | ||
cy.get('input[type="password"]').type('qwer1234!'); | ||
cy.get('.submit').click(); | ||
|
||
// 로그인 성공 후 세션 유지 확인 | ||
cy.url().should('not.include', '/sign'); | ||
// cy.getCookie('access_token').should('exist'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
describe('PaymentIndex Component', () => { | ||
beforeEach(() => { | ||
cy.intercept('GET', '/api/payment-status', { fixture: 'paymentStatus.json' }).as( | ||
'getPaymentStatus' | ||
); | ||
cy.visit('/payment'); | ||
}); | ||
|
||
it('renders payment benefits correctly', () => { | ||
// Check that the header and subscription benefits are rendered | ||
cy.get('.text-heading2').contains('구독 시작하기'); | ||
cy.get('.text-body7').should('have.length', 4); | ||
}); | ||
|
||
it('allows selecting a subscription option', () => { | ||
// Click on the first subscription option and check that it is selected | ||
cy.get('[data-testid="subscription-option"]').first().click(); | ||
cy.get('[data-testid="subscription-option"]') | ||
.first() | ||
.should('have.class', 'border-normal'); | ||
}); | ||
|
||
it('redirects to the correct page based on login status', () => { | ||
// Mock logged-in state | ||
cy.setCookie('access_token', 'validToken'); | ||
cy.get('.cta-button').click(); | ||
cy.url().should('include', '/payment/check'); | ||
|
||
// Mock logged-out state | ||
cy.clearCookie('access_token'); | ||
cy.get('.cta-button').click(); | ||
cy.url().should('include', '/sign'); | ||
}); | ||
|
||
it('handles back button click', () => { | ||
// Check that clicking the back button navigates to the previous page | ||
cy.get('.back-button').click(); | ||
cy.url().should('not.include', '/payment'); | ||
}); | ||
}); | ||
|
||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* eslint-disable */ | ||
import { logintest } from '../login.cy'; | ||
|
||
describe('Full Payment Flow', () => { | ||
beforeEach(() => { | ||
cy.intercept('GET', '/api/payment-status', { fixture: 'paymentStatus.json' }).as( | ||
'getPaymentStatus' | ||
); | ||
cy.intercept('GET', '/api/issubscribed', { subscribed: false }).as('getIsSubscribed'); | ||
// cy.setCookie('access_token', 'your-mock-token'); | ||
}); | ||
|
||
it('completes a full payment flow', () => { | ||
logintest(); | ||
cy.visit('/payment'); | ||
cy.wait(3000); | ||
cy.contains('div', '첫 달 무료체험하기').should('exist').click(); | ||
cy.url().should('include', '/payment/check'); | ||
cy.get('.subscribed_check').click(); | ||
cy.wait(1500); | ||
cy.get('.payment_start').click(); | ||
cy.wait(3000); | ||
|
||
//토스 페이먼츠 결제 테스트 | ||
|
||
cy.get('#__tosspayments_payment-gateway_iframe__') | ||
// .should('exist') | ||
.then(($iframe) => { | ||
const body = $iframe.contents().find('body'); | ||
cy.log(body.html()); | ||
cy.wrap(body) | ||
.should('not.be.empty') | ||
.within(() => { | ||
cy.get('input[aria-label="카드번호 1 ~ 4 자리"]').type('6243'); | ||
cy.get('input[aria-label="카드번호 5 ~ 8 자리"]').type('6303'); | ||
cy.get('input[aria-label="카드번호 9 ~ 12 자리"]').type('1763'); | ||
cy.get('input[aria-label="카드번호 13 ~ 16 자리"]').type('5652'); | ||
cy.get('input[aria-label="카드 유효기간"]').type('0825'); | ||
cy.get('input[aria-label="주민등록번호 생년월일"]').type('010310'); | ||
cy.get('input[aria-label="주민등록번호 성별"]').type('3'); | ||
cy.get('input[type="checkbox"]').check(); | ||
cy.contains('button', '다음').click(); | ||
}); | ||
}); | ||
|
||
cy.url().should('include', '/payment/check/confirm/successloading'); | ||
cy.get('p').contains('결제가 진행중입니다...').should('exist'); | ||
}); | ||
}); | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"subscribed": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"status": "success", | ||
"message": "Payment status retrieved successfully" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import Navbar from '@/components/common/Navbar'; | ||
import ArticleDetailClientWrapper from '@/components/learning/article/ArticleDetailClientWrapper'; | ||
|
||
interface PageProps { | ||
params: { articleId: string }; | ||
} | ||
|
||
export default function ArticleDetailPage({ params }: PageProps) { | ||
const articleId = params.articleId; | ||
|
||
return ( | ||
<> | ||
<Navbar /> | ||
<ArticleDetailClientWrapper articleId={Number(articleId)} /> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.