Skip to content
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

fix(j-s): E2E Tests #16133

Merged
merged 2 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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