Skip to content

Commit

Permalink
make tests less flaky
Browse files Browse the repository at this point in the history
  • Loading branch information
wilbrt committed Jan 9, 2025
1 parent 601c7c1 commit ed8f361
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ test-results
tmp/
deploy-scripts/dist/
/tmp
/.lsp
/.clj-kondo
10 changes: 10 additions & 0 deletions playwright/tests/hakemuksen-arviointi/koulutusosio.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,20 @@ test.describe.parallel('avustushaku with koulutusosio happy path', () => {
await osio.hyvaksyttyOsallistujaMaaraInput.fill('5')
})
await test.step('accept hakemus', async () => {
await expect(
hakemustenArviointiPage.page.locator(
"#arviointi-tab label[for='set-arvio-status-accepted']"
)
).not.toBeChecked()
await hakemustenArviointiPage.page.click(
"#arviointi-tab label[for='set-arvio-status-accepted']"
)
await hakemustenArviointiPage.waitForSave()
await expect(
hakemustenArviointiPage.page.locator(
"#arviointi-tab label[for='set-arvio-status-accepted']"
)
).toBeChecked()
})
await test.step('send paatos', async () => {
const haunTiedotPage = await hakemustenArviointiPage.header.switchToHakujenHallinta()
Expand Down
3 changes: 2 additions & 1 deletion server/config/local.edn
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@
:delete-payments? true}
:applications-ui {:enabled? true}
:dont-send-loppuselvityspyynto-to-virkailija {:enabled? true}
:test-apis {:enabled? true}}
:test-apis {:enabled? true}
:officer-edit-jwt-secret "playwright-test-secret"}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const SeurantaTags = ({ hakemus }: Props) => {
const hakemukset = useHakemustenArviointiSelector(
(state) => getLoadedAvustushakuData(state.arviointi).hakuData.hakemukset
)
const loadStatus = useHakemustenArviointiSelector((state) => state.arviointi.loadStatus)
const [newTag, setNewTag] = useState('')
const currentTags = hakemus.arvio?.tags?.value ?? []

Expand Down Expand Up @@ -82,7 +83,12 @@ const SeurantaTags = ({ hakemus }: Props) => {
<button className="btn btn-simple btn-sm btn-tag-example">Ei käytössä</button>
</h2>
{allTags.map((tag, index) => (
<button key={index} className={classNames(tag)} onClick={_.partial(onToggleTag, tag)}>
<button
key={index}
className={classNames(tag)}
onClick={_.partial(onToggleTag, tag)}
disabled={loadStatus.loadingHakemusId != null || loadStatus.loadingAvustushaku}
>
{tag}
</button>
))}
Expand Down

0 comments on commit ed8f361

Please sign in to comment.