Skip to content
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
12 changes: 0 additions & 12 deletions src/components/publication_entry.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
import type { Publication } from "@data/publications";
import type { Lang } from "@i18n/ui";
import { useTranslations } from "@i18n/utils";
import OptionalLink from "./optional_link.astro";

interface Props {
Expand All @@ -10,7 +9,6 @@ interface Props {
}

const { pub, lang } = Astro.props;
const t = useTranslations(lang);
const citationSuffix = lang === "ja" ? `,${pub.year}年` : `, ${pub.year}`;
---

Expand All @@ -22,7 +20,6 @@ const citationSuffix = lang === "ja" ? `,${pub.year}年` : `, ${pub.year}`;
<p class="pub-venue">
{pub.venueShort ?? pub.venue}{citationSuffix}
</p>
{!pub.peerReviewed && <span class="pub-review-status">{t("publications.nonPeerReviewed")}</span>}
<div class="pub-links">
{pub.pdfUrl && <a href={pub.pdfUrl} rel="noopener">PDF</a>}
{pub.slidesUrl && <a href={pub.slidesUrl} rel="noopener">Slides</a>}
Expand Down Expand Up @@ -54,15 +51,6 @@ const citationSuffix = lang === "ja" ? `,${pub.year}年` : `, ${pub.year}`;
font-style: italic;
}

.pub-review-status {
display: inline-block;
margin-top: 0.375rem;
padding: 0.125rem 0.375rem;
border: 1px solid var(--color-border);
border-radius: 0.1875rem;
color: var(--color-text-secondary);
font-size: 0.75rem;
}

.pub-links {
display: flex;
Expand Down
2 changes: 0 additions & 2 deletions src/i18n/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export const ui = {
"contact.email": "Email",
"footer.copyright": "All rights reserved.",
"publications.empty": "準備中",
"publications.nonPeerReviewed": "査読なし",
},
en: {
"nav.home": "Home",
Expand Down Expand Up @@ -80,6 +79,5 @@ export const ui = {
"contact.email": "Email",
"footer.copyright": "All rights reserved.",
"publications.empty": "Coming soon",
"publications.nonPeerReviewed": "Non-peer-reviewed",
},
} as const;
10 changes: 7 additions & 3 deletions tests/e2e/site.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,14 @@ test("renders publication collection metadata", async ({ page }) => {
await expect(publication.locator(".pub-venue")).toContainText(/, \d{4}$/);
});

test("labels non-peer-reviewed publications on Japanese pages", async ({ page }) => {
await page.goto("/ja/");
test("does not label publications with their peer-review status", async ({ page }) => {
for (const lang of ["ja", "en"] as const) {
await page.goto(`/${lang}/`);

await expect(page.locator(".pub-review-status").first()).toHaveText("査読なし");
const publications = page.locator('section[aria-labelledby="publications"]');
await expect(publications.locator(".pub-entry").first()).toBeVisible();
await expect(publications.getByText(/査読|peer-reviewed/i)).toHaveCount(0);
}
});

test("uses localized alternative text for the profile portrait", async ({ page }) => {
Expand Down
Loading