Skip to content

Commit

Permalink
Merge branch 'browser-compatibility-tests' into browser-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chiaryan committed Nov 12, 2024
2 parents bf9f160 + f86888b commit b0b9fb5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
9 changes: 5 additions & 4 deletions apps/frontend/__tests__/browser-tests/browser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ describe("chrome browser", () => {
await driver.get('http://www.google.com');
await driver.findElement(By.name('q')).sendKeys('webdriver', Key.RETURN);
await driver.wait(until.titleIs('webdriver - Google Search'), 1000);
});
}, 10000);
it("does another google search", async () => {
await driver.get('http://www.google.com');
await driver.findElement(By.name('q')).sendKeys('webdriver', Key.RETURN);
await driver.wait(until.titleIs('webdriver - Google Search'), 1000);
});
}, 10000);
});

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

expect(slogan1 + slogan2).toBe("A better way to prepare for coding interviews withpeers");
});
expect(slogan1).toBe("A better way to prepare for coding interviews with");
expect(slogan2).toBe("peers");
}, 10000);
})
})

Expand Down
12 changes: 6 additions & 6 deletions apps/frontend/__tests__/unit-tests/question.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ describe("GetQuestions", () => {

});

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

const res = await GetQuestions(2)

Expand All @@ -138,7 +138,7 @@ describe("GetQuestions", () => {
}]])
});

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

await GetQuestions(undefined, 3)

Expand All @@ -150,7 +150,7 @@ describe("GetQuestions", () => {
}]])
});

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

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

Expand All @@ -162,7 +162,7 @@ describe("GetQuestions", () => {
}]])
});

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

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

Expand All @@ -174,7 +174,7 @@ describe("GetQuestions", () => {
}]])
});

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

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

Expand All @@ -189,7 +189,7 @@ describe("GetQuestions", () => {
]])
});

it("formats url for title", async () => {
it("formats title params correctly", async () => {

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

Expand Down
4 changes: 2 additions & 2 deletions apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"start": "next start",
"lint": "next lint",
"test": "jest",
"unit-test": "jest __tests__/unit-tests",
"browser-test": "jest __tests__/browser-tests"
"unit-test": "jest --verbose __tests__/unit-tests",
"browser-test": "jest --verbose __tests__/browser-tests"
},
"dependencies": {
"@ant-design/icons": "^5.5.1",
Expand Down

0 comments on commit b0b9fb5

Please sign in to comment.