Skip to content

Commit

Permalink
Remove redundant awaits found in PyCharm and await-thenable linting (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
liamtoozer authored Jan 9, 2024
1 parent 39e7a59 commit 420f6a8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions tests/functional/spec/custom_page_titles.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ describe("Feature: Custom Page Titles", () => {

await $(RelationshipsPage.husbandOrWife()).click();
await click(RelationshipsPage.submit());
expectedPageTitle = browser.getTitle();
await expect(await expectedPageTitle).toBe("How Person 1 is related to Person 3 - Test Custom Page Titles");
expectedPageTitle = await browser.getTitle();
await expect(expectedPageTitle).toBe("How Person 1 is related to Person 3 - Test Custom Page Titles");

await $(RelationshipsPage.sonOrDaughter()).click();
await click(RelationshipsPage.submit());
expectedPageTitle = await browser.getTitle();
await expect(await expectedPageTitle).toBe("How Person 2 is related to Person 3 - Test Custom Page Titles");
await expect(expectedPageTitle).toBe("How Person 2 is related to Person 3 - Test Custom Page Titles");

await $(RelationshipsPage.sonOrDaughter()).click();
await click(RelationshipsPage.submit());
expectedPageTitle = await browser.getTitle();
await expect(await expectedPageTitle).toBe("Custom section summary page title - Test Custom Page Titles");
await expect(expectedPageTitle).toBe("Custom section summary page title - Test Custom Page Titles");
});

it("When I navigate to list edit and remove pages Then I should see the custom page titles", async () => {
Expand All @@ -74,7 +74,7 @@ describe("Feature: Custom Page Titles", () => {
await $(ListCollectorEditPage.previous()).click();
await $(ListCollectorPage.listRemoveLink(1)).click();
expectedPageTitle = await browser.getTitle();
await expect(await expectedPageTitle).toBe("Remove person 1 - Test Custom Page Titles");
await expect(expectedPageTitle).toBe("Remove person 1 - Test Custom Page Titles");
});

it("When I navigate to a repeating section which has custom page title, Then all page titles in the section should have the correct prefix", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ testCases.forEach((testCase) => {

describe("Given a dynamic answer options questionnaire and I am on the radio answer page", () => {
it("When I click a radio option, then the radio should be selected", async () => {
for (let i = 0; i < (await testCase.answerOptionCount); i++) {
for (let i = 0; i < testCase.answerOptionCount; i++) {
await $(DynamicRadioPage.answerByIndex(i)).click();
await expect(await $(DynamicRadioPage.answerByIndex(i)).isSelected()).toBe(true);
}
Expand Down Expand Up @@ -88,14 +88,14 @@ testCases.forEach((testCase) => {

describe("Given a dynamic answer options questionnaire and I am on the mutually exclusive page", () => {
it("When I click a dynamic checkbox option, then the checkbox should be selected", async () => {
for (let i = 0; i < (await testCase.answerOptionCount); i++) {
for (let i = 0; i < testCase.answerOptionCount; i++) {
await $(DynamicMutuallyExclusivePage.answerByIndex(i)).click();
await expect(await $(DynamicMutuallyExclusivePage.answerByIndex(i)).isSelected()).toBe(true);
}
});

it("When I click a selected option, then it should be deselected", async () => {
for (let i = 0; i < (await testCase.answerOptionCount); i++) {
for (let i = 0; i < testCase.answerOptionCount; i++) {
await $(DynamicMutuallyExclusivePage.answerByIndex(i)).click();
await expect(await $(DynamicMutuallyExclusivePage.answerByIndex(i)).isSelected()).toBe(false);
}
Expand Down
10 changes: 5 additions & 5 deletions tests/functional/spec/features/routing/date.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ describe("Feature: Routing on a Date", () => {

const browserUrl = await browser.getUrl();

await expect(await browserUrl).toContain(CorrectAnswerPage.pageName);
await expect(browserUrl).toContain(CorrectAnswerPage.pageName);
});

it("When I enter a date equal to today, Then I should be routed to the incorrect page", async () => {
Expand All @@ -232,7 +232,7 @@ describe("Feature: Routing on a Date", () => {

const browserUrl = await browser.getUrl();

await expect(await browserUrl).toContain(IncorrectAnswerPage.pageName);
await expect(browserUrl).toContain(IncorrectAnswerPage.pageName);
});

it("When I enter a date greater than today, Then I should be routed to the incorrect page", async () => {
Expand All @@ -243,7 +243,7 @@ describe("Feature: Routing on a Date", () => {

const browserUrl = await browser.getUrl();

await expect(await browserUrl).toContain(IncorrectAnswerPage.pageName);
await expect(browserUrl).toContain(IncorrectAnswerPage.pageName);
});
});
});
Expand Down Expand Up @@ -273,7 +273,7 @@ describe("Feature: Routing on a Date", () => {

const browserUrl = await browser.getUrl();

await expect(await browserUrl).toContain(CorrectAnswerPage.pageName);
await expect(browserUrl).toContain(CorrectAnswerPage.pageName);
});

it("When I enter a date greater than today, Then I should be routed to the incorrect page", async () => {
Expand All @@ -284,7 +284,7 @@ describe("Feature: Routing on a Date", () => {

const browserUrl = await browser.getUrl();

await expect(await browserUrl).toContain(IncorrectAnswerPage.pageName);
await expect(browserUrl).toContain(IncorrectAnswerPage.pageName);
});
});
});
Expand Down

0 comments on commit 420f6a8

Please sign in to comment.