Skip to content

Commit b0b9fb5

Browse files
committed
Merge branch 'browser-compatibility-tests' into browser-tests
2 parents bf9f160 + f86888b commit b0b9fb5

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

apps/frontend/__tests__/browser-tests/browser.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ describe("chrome browser", () => {
2323
await driver.get('http://www.google.com');
2424
await driver.findElement(By.name('q')).sendKeys('webdriver', Key.RETURN);
2525
await driver.wait(until.titleIs('webdriver - Google Search'), 1000);
26-
});
26+
}, 10000);
2727
it("does another google search", async () => {
2828
await driver.get('http://www.google.com');
2929
await driver.findElement(By.name('q')).sendKeys('webdriver', Key.RETURN);
3030
await driver.wait(until.titleIs('webdriver - Google Search'), 1000);
31-
});
31+
}, 10000);
3232
});
3333

3434
describe("browser-test", () => {
@@ -48,8 +48,9 @@ describe("chrome browser", () => {
4848
const slogan1 = await driver.findElement(By.xpath("/html/body/div[1]/main/div/div[1]/div[2]/span[1]")).then(ele => ele.getText())
4949
const slogan2 = await driver.findElement(By.xpath("/html/body/div[1]/main/div/div[1]/div[2]/span[2]")).then(ele => ele.getText())
5050

51-
expect(slogan1 + slogan2).toBe("A better way to prepare for coding interviews withpeers");
52-
});
51+
expect(slogan1).toBe("A better way to prepare for coding interviews with");
52+
expect(slogan2).toBe("peers");
53+
}, 10000);
5354
})
5455
})
5556

apps/frontend/__tests__/unit-tests/question.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ describe("GetQuestions", () => {
126126

127127
});
128128

129-
it("gets all questions on the 2nd page with (2) call", async () => {
129+
it("formats (page=2) params correctly", async () => {
130130

131131
const res = await GetQuestions(2)
132132

@@ -138,7 +138,7 @@ describe("GetQuestions", () => {
138138
}]])
139139
});
140140

141-
it("gets all questions on the 2nd page with (limit=3) call", async () => {
141+
it("formats (limit=3) params correctly", async () => {
142142

143143
await GetQuestions(undefined, 3)
144144

@@ -150,7 +150,7 @@ describe("GetQuestions", () => {
150150
}]])
151151
});
152152

153-
it("gets all questions on the 2nd page with (limit=3) call", async () => {
153+
it("formats (difficulty asc) params correctly", async () => {
154154

155155
await GetQuestions(undefined, undefined, "difficulty asc")
156156

@@ -162,7 +162,7 @@ describe("GetQuestions", () => {
162162
}]])
163163
});
164164

165-
it("gets all questions on the 2nd page with (limit=3) call", async () => {
165+
it("formats ([\"easy\", \"hard\"]) params correctly", async () => {
166166

167167
await GetQuestions(undefined, undefined, undefined, ["easy", "hard"])
168168

@@ -174,7 +174,7 @@ describe("GetQuestions", () => {
174174
}]])
175175
});
176176

177-
it("formats urls for categories", async () => {
177+
it("formats cat params correctly", async () => {
178178

179179
await GetQuestions(undefined, undefined, undefined, undefined, ["CatA", "CatB"])
180180

@@ -189,7 +189,7 @@ describe("GetQuestions", () => {
189189
]])
190190
});
191191

192-
it("formats url for title", async () => {
192+
it("formats title params correctly", async () => {
193193

194194
await GetQuestions(undefined, undefined, undefined, undefined, undefined, "The Title Name")
195195

apps/frontend/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"start": "next start",
99
"lint": "next lint",
1010
"test": "jest",
11-
"unit-test": "jest __tests__/unit-tests",
12-
"browser-test": "jest __tests__/browser-tests"
11+
"unit-test": "jest --verbose __tests__/unit-tests",
12+
"browser-test": "jest --verbose __tests__/browser-tests"
1313
},
1414
"dependencies": {
1515
"@ant-design/icons": "^5.5.1",

0 commit comments

Comments
 (0)