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

Piilota poissaolokyselyn toast-viesti, mikäli kyselyyn on jo vastattu #6320

Merged
merged 1 commit into from
Feb 4, 2025
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 @@ -107,7 +107,12 @@ export default React.memo(function CalendarNotifications({
if (activeQuestionnaire === undefined) return

let cta: HolidayCta
if (activeQuestionnaire) {
if (
activeQuestionnaire &&
activeQuestionnaire.eligibleChildren.some(
(c) => !activeQuestionnaire.previousAnswers.some((a) => a.childId === c)
)
) {
cta = {
type: 'questionnaire',
deadline: activeQuestionnaire.questionnaire.active.end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,18 @@ describe('Holiday periods and questionnaires', () => {
)
})

test('The holiday reservations toast is hidden after answering questionnaire', async () => {
await enduserLogin(page, guardian)
await new CitizenHeader(page).selectTab('calendar')
const calendar = new CitizenCalendarPage(page, 'desktop')
await calendar.assertHolidayCtaContent(
'Vastaa poissaolokyselyyn 06.12.2035 mennessä.'
)
const holidayModal = await calendar.openHolidayModal()
await holidayModal.markNoHoliday(child)
await calendar.assertHolidayCtaNotVisible()
})

test('Clicking on the holiday reservations toast opens the holiday modal', async () => {
await enduserLogin(page, guardian)
await new CitizenHeader(page).selectTab('calendar')
Expand Down