Skip to content

Commit

Permalink
test: refactor client test code
Browse files Browse the repository at this point in the history
  • Loading branch information
FullOfOrange committed Dec 13, 2019
1 parent bd9a92b commit 2303f48
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions client/cypress/integration/eventjoin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ context('์ด๋ฒคํŠธ ์˜ˆ์•ฝ ํŽ˜์ด์ง€', () => {
it('๋กœ๊ทธ์ธ์ด ๋˜์–ด์žˆ์ง€ ์•Š์€ ์ƒํƒœ๋กœ ์˜ˆ์•ฝ์„ ์‹œ๋„ํ•˜๋ฉด alert์™€ login์œผ๋กœ ๋ฆฌ๋‹ค์ด๋ ‰์…˜์ด ์ด๋ฃจ์–ด์ง„๋‹ค', () => {
cy.route({
method: 'POST',
url: '/api/users/ticket',
url: '/api/users/reserve',
status: 401,
response: {},
});
Expand All @@ -99,7 +99,7 @@ context('์ด๋ฒคํŠธ ์˜ˆ์•ฝ ํŽ˜์ด์ง€', () => {
it('์˜ˆ์•ฝ ์‘๋‹ต์ด NOT_FOUND ์ด๋ผ๋ฉด alert๊ฐ€ ํ‘œ์‹œ๋œ๋‹ค', () => {
cy.route({
method: 'POST',
url: '/api/users/ticket',
url: '/api/users/reserve',
status: 404,
response: {},
});
Expand All @@ -118,7 +118,7 @@ context('์ด๋ฒคํŠธ ์˜ˆ์•ฝ ํŽ˜์ด์ง€', () => {
it('์˜ˆ์•ฝ ์‘๋‹ต์ด FORBIDDEN / ์œ ํšจํ•˜์ง€ ์•Š์€ ์ผ์ •์ด๋ผ๋ฉด alert๊ฐ€ ํ‘œ์‹œ๋œ๋‹ค', () => {
cy.route({
method: 'POST',
url: '/api/users/ticket',
url: '/api/users/reserve',
status: 403,
response: { state: NOT_OPEN },
});
Expand All @@ -137,7 +137,7 @@ context('์ด๋ฒคํŠธ ์˜ˆ์•ฝ ํŽ˜์ด์ง€', () => {
it('์˜ˆ์•ฝ ์‘๋‹ต์ด FORBIDDEN / ๋งค์ง„์ด๋ผ๋ฉด alert๊ฐ€ ํ‘œ์‹œ๋œ๋‹ค', () => {
cy.route({
method: 'POST',
url: '/api/users/ticket',
url: '/api/users/reserve',
status: 403,
response: { state: SOLD_OUT },
});
Expand All @@ -156,7 +156,7 @@ context('์ด๋ฒคํŠธ ์˜ˆ์•ฝ ํŽ˜์ด์ง€', () => {
it('์˜ˆ์•ฝ ์‘๋‹ต์ด FORBIDDEN / 1์ธ๋‹น ํ‹ฐ์ผ“ ๊ฐœ์ˆ˜ ์ดˆ๊ณผ๋ผ๋ฉด alert๊ฐ€ ํ‘œ์‹œ๋œ๋‹ค', () => {
cy.route({
method: 'POST',
url: '/api/users/ticket',
url: '/api/users/reserve',
status: 403,
response: { state: EXCEED_LIMIT },
});
Expand All @@ -173,7 +173,7 @@ context('์ด๋ฒคํŠธ ์˜ˆ์•ฝ ํŽ˜์ด์ง€', () => {
});

it('์˜ˆ์•ฝ์ด ์„ฑ๊ณต์ ์œผ๋กœ ์ด๋ฃจ์–ด์ง€๋ฉด alert์™€ main์œผ๋กœ ๋ฆฌ๋‹ค์ด๋ ‰์…˜์ด ์ด๋ฃจ์–ด์ง„๋‹ค', () => {
cy.route('POST', '/api/users/ticket', {});
cy.route('POST', '/api/users/reserve', {});

goPurchasePage();
const alertStub = cy.stub();
Expand Down

0 comments on commit 2303f48

Please sign in to comment.