-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: 14609 - playwright test for adding adding a row and editing a codelist for org #14807
test: 14609 - playwright test for adding adding a row and editing a codelist for org #14807
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## org-library-mvp #14807 +/- ##
================================================
Coverage 95.79% 95.79%
================================================
Files 1936 1936
Lines 25245 25245
Branches 2859 2859
================================================
Hits 24184 24184
Misses 800 800
Partials 261 261 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jeg har noen forslag til navngivning av diverse ting i denne PR-en. Det er viktig for å oppnå en kode som sier presist hva den gjør samtidig som den kommuniserer intensjonen bak funksjonene. La meg få vite hva du tenker.
frontend/testing/playwright/tests/org-library/codelists.spec.ts
Outdated
Show resolved
Hide resolved
frontend/testing/playwright/tests/org-library/codelists.spec.ts
Outdated
Show resolved
Hide resolved
frontend/testing/playwright/tests/org-library/codelists.spec.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nå synes jeg det ble mye bedre! Oppdaget bare noen små følgefeil.
public async verifyEmptyLabelTextfield(itemNumber: number): Promise<void> { | ||
const textfield = this.page.getByRole('textbox', { | ||
name: this.textMock('code_list_editor.value_item', { number: itemNumber.toString() }), | ||
exact: true, | ||
}); | ||
|
||
await expect(textfield).toHaveValue(''); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public async verifyEmptyLabelTextfield(itemNumber: number): Promise<void> { | |
const textfield = this.page.getByRole('textbox', { | |
name: this.textMock('code_list_editor.value_item', { number: itemNumber.toString() }), | |
exact: true, | |
}); | |
await expect(textfield).toHaveValue(''); | |
} | |
public async verifyEmptyLabelTextfield(itemNumber: number): Promise<void> { | |
await this.verifyLabelTextfield(itemNumber, ''); | |
} |
}) | ||
.click(); | ||
public async verifyEmptyValueTextfield(itemNumber: number): Promise<void> { | ||
this.verifyValueTextfield(itemNumber, ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Denne tar jeg på min kappe siden det var mitt forslag. Vi bør ha med await
foran.
this.verifyValueTextfield(itemNumber, ''); | |
await this.verifyValueTextfield(itemNumber, ''); |
@@ -10,7 +10,9 @@ const TEST_ORG: string = 'ttd'; | |||
const CODELIST_TITLE_MANUALLY: string = 'Test_codelist'; | |||
const CODELIST_TITLE_UPLOADED: string = 'testCodelist'; | |||
|
|||
const EXPECTED_NUMBER_OF_ROWS_IN_MANUALLY_CODELIST: number = 1; | |||
const EXPECTED_NUMBER_OF_ITEMS_IN_MANUALLY_CREATED_CODELIST: number = 1; | |||
const EXPECTED_NUMBER_OF_ROWS_IN_MANUALLY_CODELIST_AFTER_ADDING_ROW: number = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const EXPECTED_NUMBER_OF_ROWS_IN_MANUALLY_CODELIST_AFTER_ADDING_ROW: number = | |
const EXPECTED_NUMBER_OF_ROWS_IN_MANUALLY_CREATED_CODELIST_AFTER_ADDING_ROW: number = |
|
||
await orgLibraryPage.codeLists.clickOnAddItemButton(); | ||
await orgLibraryPage.codeLists.verifyNumberOfItemsInTheCodelist( | ||
EXPECTED_NUMBER_OF_ROWS_IN_MANUALLY_CODELIST_AFTER_ADDING_ROW, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EXPECTED_NUMBER_OF_ROWS_IN_MANUALLY_CODELIST_AFTER_ADDING_ROW, | |
EXPECTED_NUMBER_OF_ROWS_IN_MANUALLY_CREATED_CODELIST_AFTER_ADDING_ROW, |
); | ||
|
||
const lastlyAddedItemNumber: number = | ||
EXPECTED_NUMBER_OF_ROWS_IN_MANUALLY_CODELIST_AFTER_ADDING_ROW; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EXPECTED_NUMBER_OF_ROWS_IN_MANUALLY_CODELIST_AFTER_ADDING_ROW; | |
EXPECTED_NUMBER_OF_ROWS_IN_MANUALLY_CREATED_CODELIST_AFTER_ADDING_ROW; |
@@ -91,7 +127,7 @@ test('that it is possible to search for and delete the new codelists', async ({ | |||
await deleteAndVerifyDeletionOfCodeList( | |||
orgLibraryPage, | |||
CODELIST_TITLE_MANUALLY, | |||
EXPECTED_NUMBER_OF_ROWS_IN_MANUALLY_CODELIST, | |||
EXPECTED_NUMBER_OF_ROWS_IN_MANUALLY_CODELIST_AFTER_ADDING_ROW, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EXPECTED_NUMBER_OF_ROWS_IN_MANUALLY_CODELIST_AFTER_ADDING_ROW, | |
EXPECTED_NUMBER_OF_ROWS_IN_MANUALLY_CREATED_CODELIST_AFTER_ADDING_ROW, |
Description
Related Issue(s)
Verification