diff --git a/e2e/log.spec.ts b/e2e/log.spec.ts index 4370191..ed59519 100644 --- a/e2e/log.spec.ts +++ b/e2e/log.spec.ts @@ -67,3 +67,25 @@ test('achievement notifications work', async ({page}) => { await page.getByTestId('dialog-close-button').click(); await expect(page.getByTestId('dialog')).toBeHidden(); }); + +test('weekly achievement works', async ({page}) => { + await page.goto('/'); + await page.getByTestId('home-start-button').click(); + await page.getByTestId('veggie-search-button').click(); + const fruits = ( + await page.getByTestId('veggie-search-group-Fruit').locator('.veggie-search__option').all() + ).slice(0, 10); + const vegetables = ( + await page.getByTestId('veggie-search-group-Vegetable').locator('.veggie-search__option').all() + ).slice(0, 10); + const grains = ( + await page.getByTestId('veggie-search-group-Grain').locator('.veggie-search__option').all() + ).slice(0, 10); + for (const element of fruits.concat(vegetables, grains)) { + await element.click(); + } + await expect(page.getByTestId('dialog')).toBeVisible(); + await expect(page.getByTestId('badge-thirtyVeggies-3')).toBeVisible(); + await page.getByTestId('dialog-close-button').click(); + await expect(page.getByTestId('dialog')).toBeHidden(); +}); diff --git a/src/components/AchievementBadge.vue b/src/components/AchievementBadge.vue index bd505b8..228ad58 100644 --- a/src/components/AchievementBadge.vue +++ b/src/components/AchievementBadge.vue @@ -114,6 +114,12 @@ const achievementProps: AchievementProps = { emoji: CATEGORY_EMOJI.Vegetable, }, }, + thirtyVeggies: { + [AchievementLevel.Gold]: { + textProps: [], + emoji: '🎉', + }, + }, };