diff --git a/content/activities/fukuoka_mitou_2023.yaml b/content/activities/fukuoka_mitou_2023.yaml index d24600b..1c460b8 100644 --- a/content/activities/fukuoka_mitou_2023.yaml +++ b/content/activities/fukuoka_mitou_2023.yaml @@ -4,4 +4,4 @@ title: ja: "福岡未踏 Solve に採択され,LLM-chatbot をチームで開発しました." en: "Selected for Fukuoka Mitou (Solve) and built LLM-chatbot with a team." url: "https://note.com/mitou_fukuoka/n/n397fe44895c6" -type: "program" +type: "selection" diff --git a/src/components/activity_entry.astro b/src/components/activity_entry.astro index 93a70ba..510dbde 100644 --- a/src/components/activity_entry.astro +++ b/src/components/activity_entry.astro @@ -59,6 +59,14 @@ const title = pickLocale(item.title, lang); background: #7c8cf5; } + .badge-selection { + background: #f5a623; + } + + .badge-study-abroad { + background: #f28cb1; + } + @media (width < 640px) { .activity-entry { flex-wrap: wrap; diff --git a/src/data/site_record_schema.test.ts b/src/data/site_record_schema.test.ts index bab6c33..b539aab 100644 --- a/src/data/site_record_schema.test.ts +++ b/src/data/site_record_schema.test.ts @@ -29,7 +29,7 @@ test("rejects activity dates outside the ISO date format", () => { expect(result.success).toBe(false); }); -test("accepts a program activity with an end date", () => { +test("accepts a study-abroad activity with an end date", () => { const result = activitySchema.safeParse({ date: "2024-08-16", endDate: "2024-09-23", @@ -44,8 +44,8 @@ test("rejects an activity that ends before it starts", () => { const result = activitySchema.safeParse({ date: "2024-01-31", endDate: "2023-11-01", - title: { ja: "プログラム", en: "Program" }, - type: "program", + title: { ja: "採択", en: "Selection" }, + type: "selection", }); expect(result.success).toBe(false); diff --git a/src/data/site_record_schema.ts b/src/data/site_record_schema.ts index 396e90a..4b023ce 100644 --- a/src/data/site_record_schema.ts +++ b/src/data/site_record_schema.ts @@ -13,7 +13,7 @@ export const activitySchema = z endDate: z.iso.date().optional(), title: localizedTextSchema, url: z.url().optional(), - type: z.enum(["paper", "talk", "award", "program", "study-abroad", "general"]), + type: z.enum(["paper", "talk", "award", "selection", "study-abroad", "general"]), }) .strict() .refine(({ date, endDate }) => endDate === undefined || date <= endDate, { diff --git a/src/i18n/ui.ts b/src/i18n/ui.ts index 916eb1a..d956181 100644 --- a/src/i18n/ui.ts +++ b/src/i18n/ui.ts @@ -31,7 +31,7 @@ export const ui = { "activity.type.paper": "論文", "activity.type.talk": "発表", "activity.type.award": "受賞", - "activity.type.program": "プログラム", + "activity.type.selection": "採択", "activity.type.study-abroad": "留学", "activity.type.general": "お知らせ", "blog.readMore": "続きを読む", @@ -67,7 +67,7 @@ export const ui = { "activity.type.paper": "Paper", "activity.type.talk": "Talk", "activity.type.award": "Award", - "activity.type.program": "Program", + "activity.type.selection": "Selected", "activity.type.study-abroad": "Study abroad", "activity.type.general": "News", "blog.readMore": "Read more", diff --git a/tests/e2e/site.spec.ts b/tests/e2e/site.spec.ts index ed5e85c..57eba22 100644 --- a/tests/e2e/site.spec.ts +++ b/tests/e2e/site.spec.ts @@ -150,10 +150,10 @@ test("renders activity collection records with localized type labels", async ({ const entry = page.locator(".activity-entry").first(); await expect(entry).toBeVisible(); await expect(entry.locator("time").first()).toHaveAttribute("datetime", /^\d{4}-\d{2}-\d{2}$/); - await expect(entry.locator(".badge")).toHaveText(/^(論文|発表|受賞|プログラム|留学|お知らせ)$/); + await expect(entry.locator(".badge")).toHaveText(/^(論文|発表|受賞|採択|留学|お知らせ)$/); }); -test("shows dated programs with their periods and links", async ({ page }) => { +test("shows dated activities with their periods, labels, and links", async ({ page }) => { await page.goto("/en/"); const activities = page.locator('section[aria-labelledby="activities"]'); @@ -164,9 +164,10 @@ test("shows dated programs with their periods and links", async ({ page }) => { "href", "https://www.eng.kyushu-u.ac.jp/programs/program-q2pec/", ); - const program = activities.locator(".activity-entry", { hasText: "Fukuoka Mitou" }); - await expect(program).toContainText("2023.11–2024.01"); - await expect(program.getByRole("link")).toHaveAttribute( + const selection = activities.locator(".activity-entry", { hasText: "Fukuoka Mitou" }); + await expect(selection).toContainText("2023.11–2024.01"); + await expect(selection.locator(".badge")).toHaveText("Selected"); + await expect(selection.getByRole("link")).toHaveAttribute( "href", "https://note.com/mitou_fukuoka/n/n397fe44895c6", );