Skip to content

Commit 876be54

Browse files
committed
사용하지 않는 메소드 moveToPaymentHistoryURL 제거
1 parent 99f4a3e commit 876be54

File tree

2 files changed

+12
-34
lines changed

2 files changed

+12
-34
lines changed

src/app/naver/urlChanger.test.ts

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,17 @@
11
import URLChanger from "./urlChanger";
22

3-
describe("Login", () => {
4-
it("Should move page to login", async () => {
5-
// given
6-
const urlChanger = new URLChanger(page);
7-
const pageSpy = jest.spyOn(page, "goto");
3+
describe("URLChanger", () => {
4+
describe("moveToLoginURL", () => {
5+
it("Should move page to login", async () => {
6+
// given
7+
const urlChanger = new URLChanger(page);
8+
const pageSpy = jest.spyOn(page, "goto");
89

9-
// when
10-
await urlChanger.moveToLoginURL();
10+
// when
11+
await urlChanger.moveToLoginURL();
1112

12-
// then
13-
expect(pageSpy).toHaveBeenCalledWith(urlChanger.loginURL);
14-
});
15-
});
16-
17-
describe("PaymentHistory", () => {
18-
it("Should move page to payment history", async () => {
19-
// given
20-
const urlChanger = new URLChanger(page);
21-
const pageSpy = jest.spyOn(page, "goto");
22-
const waitForSelectorSpy = jest.spyOn(page, "waitForSelector");
23-
waitForSelectorSpy.mockImplementation(() => Promise.resolve(null));
24-
25-
// when
26-
await urlChanger.moveToPaymentHistoryURL();
27-
28-
// then
29-
expect(pageSpy).toHaveBeenCalledWith(urlChanger.paymentHistoryURL);
13+
// then
14+
expect(pageSpy).toHaveBeenCalledWith(urlChanger.loginURL);
15+
});
3016
});
3117
});

src/app/naver/urlChanger.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
11
import puppeteer from "puppeteer";
22

33
export default class URLChanger {
4-
loginURL = "https://nid.naver.com/nidlogin.login";
5-
paymentHistoryURL =
6-
"https://new-m.pay.naver.com/historybenefit/paymenthistory";
7-
84
constructor(private readonly page: puppeteer.Page) {
95
this.page = page;
106
}
117

8+
loginURL = "https://nid.naver.com/nidlogin.login";
129
async moveToLoginURL() {
1310
await this.page.goto(this.loginURL);
1411
}
15-
16-
async moveToPaymentHistoryURL() {
17-
await this.page.goto(this.paymentHistoryURL);
18-
await this.page.waitForSelector("div[class^='paymentHistory_section__']");
19-
}
2012
}

0 commit comments

Comments
 (0)