Skip to content

Commit

Permalink
Updates e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gudjong committed Sep 24, 2024
1 parent 4e76ba9 commit cfedcac
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ export const HearingArrangements = () => {
[formatMessage, router, setWorkingCase, transitionCase, workingCase],
)

const stepIsValid =
isHearingArrangementsStepValidRC(workingCase) || isTransitioningCase
const stepIsValid = isHearingArrangementsStepValidRC(workingCase)

return (
<PageLayout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ test.describe.serial('Custody tests', () => {
.fill(randomPoliceCaseNumber())
await page.getByRole('button', { name: 'Skrá númer' }).click()
await page.getByRole('checkbox').first().check()
await page.locator('input[name=accusedName]').fill(faker.name.findName())
await page.locator('input[name=inputName]').fill(faker.name.findName())
await page.locator('input[name=accusedAddress]').fill('Einhversstaðar 1')
await page.locator('#defendantGender').click()
await page.locator('#react-select-defendantGender-option-0').click()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ test.describe.serial('Indictment tests', () => {
await page
.getByRole('checkbox', { name: 'Ákærði er ekki með íslenska kennitölu' })
.check()
await page.getByTestId('nationalId').click()
await page.getByTestId('nationalId').fill('01.01.2000')
await page.getByTestId('accusedName').click()
await page.getByTestId('accusedName').fill(accusedName)
await page.getByTestId('accusedName').press('Tab')
await page.getByTestId('inputNationalId').click()
await page.getByTestId('inputNationalId').fill('01.01.2000')
await page.getByTestId('inputName').click()
await page.getByTestId('inputName').fill(accusedName)
await page.getByTestId('inputName').press('Tab')
await page.getByTestId('accusedAddress').fill('Testgata 12')
await page.locator('#defendantGender').click()
await page.locator('#react-select-defendantGender-option-0').click()
Expand Down Expand Up @@ -78,10 +78,15 @@ test.describe.serial('Indictment tests', () => {
page.getByText('Játar sök').click(),
verifyRequestCompletion(page, '/api/graphql', 'UpdateDefendant'),
])
await Promise.all([
page.getByText('Nei').last().click(),
verifyRequestCompletion(page, '/api/graphql', 'UpdateCase'),
])
await Promise.all([
page.getByTestId('continueButton').click(),
verifyRequestCompletion(page, '/api/graphql', 'Case'),
])

// Case files
await expect(page).toHaveURL(`/akaera/domskjol/${caseId}`)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ test.describe.serial('Search warrant tests', () => {
await page.locator('#type').click()
await page.locator('#react-select-type-option-0').click()
await page.getByRole('checkbox').first().check()
await page.locator('input[name=accusedName]').fill(faker.name.findName())
await page.locator('input[name=inputName]').fill(faker.name.findName())
await page.locator('input[name=accusedAddress]').fill('Einhversstaðar 1')
await page.locator('#defendantGender').click()
await page.locator('#react-select-defendantGender-option-0').click()
Expand Down

0 comments on commit cfedcac

Please sign in to comment.