content: label the Experience chapter Experience in the navigation
This commit is contained in:
@@ -18,7 +18,7 @@ const props = defineProps<{
|
||||
const navigationLabels: Readonly<Record<SectionId, string>> = {
|
||||
start: "Start",
|
||||
profile: "Profile",
|
||||
experience: "Career",
|
||||
experience: "Experience",
|
||||
infrastructure: "Infra",
|
||||
"selected-builds": "Builds",
|
||||
"additional-work": "More work",
|
||||
|
||||
@@ -220,33 +220,27 @@ test("responsive navigation exposes the exact visible label as each link's acces
|
||||
await page.goto(distUrl, { waitUntil: "domcontentloaded" });
|
||||
|
||||
await expect(
|
||||
page.getByRole("link", { name: "Career", exact: true }),
|
||||
page.getByRole("link", { name: "Experience", exact: true }),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page.getByRole("link", { name: "More work", exact: true }),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page.getByRole("link", { name: "Experience", exact: true }),
|
||||
).toHaveCount(0);
|
||||
await expect(
|
||||
page.getByRole("link", { name: "Additional work", exact: true }),
|
||||
).toHaveCount(0);
|
||||
|
||||
await page.setViewportSize({ width: 320, height: 800 });
|
||||
await revealNavigationLinks(page);
|
||||
const career = page.getByRole("link", { name: "Career", exact: true });
|
||||
await expect(career).toHaveText("Career");
|
||||
const experience = page.getByRole("link", { name: "Experience", exact: true });
|
||||
await expect(experience).toHaveText("Experience");
|
||||
await expect(
|
||||
page.getByRole("link", { name: "More work", exact: true }),
|
||||
).toHaveText("More work");
|
||||
await expect(
|
||||
page.getByRole("link", { name: "Experience", exact: true }),
|
||||
).toHaveCount(0);
|
||||
await expect(
|
||||
page.getByRole("link", { name: "Additional work", exact: true }),
|
||||
).toHaveCount(0);
|
||||
|
||||
await career.focus();
|
||||
await experience.focus();
|
||||
await page.keyboard.press("Enter");
|
||||
await expect(page.locator("#experience-heading")).toBeFocused();
|
||||
});
|
||||
|
||||
@@ -28,7 +28,7 @@ const navigationLabels: Readonly<Record<(typeof sectionIds)[number], string>> =
|
||||
{
|
||||
start: "Start",
|
||||
profile: "Profile",
|
||||
experience: "Career",
|
||||
experience: "Experience",
|
||||
infrastructure: "Infra",
|
||||
"selected-builds": "Builds",
|
||||
"additional-work": "More work",
|
||||
|
||||
@@ -107,7 +107,7 @@ describe('semantic portfolio document', () => {
|
||||
const additional = document.querySelector('nav a[href="#additional-work"]')!;
|
||||
|
||||
expect(experience.hasAttribute('aria-label')).toBe(false);
|
||||
expect(experience.textContent).toBe('Career');
|
||||
expect(experience.textContent).toBe('Experience');
|
||||
expect(experience.childElementCount).toBe(0);
|
||||
expect(additional.hasAttribute('aria-label')).toBe(false);
|
||||
expect(additional.textContent).toBe('More work');
|
||||
@@ -136,7 +136,7 @@ describe('semantic portfolio document', () => {
|
||||
'Profile', 'Experience', 'Infrastructure', 'Selected builds', 'Additional work', 'Toolkit', 'Contact',
|
||||
]);
|
||||
expect([...document.querySelectorAll('nav a')].map((link) => [link.getAttribute('href'), link.textContent])).toEqual([
|
||||
['#start', 'Start'], ['#profile', 'Profile'], ['#experience', 'Career'], ['#infrastructure', 'Infra'],
|
||||
['#start', 'Start'], ['#profile', 'Profile'], ['#experience', 'Experience'], ['#infrastructure', 'Infra'],
|
||||
['#selected-builds', 'Builds'], ['#additional-work', 'More work'], ['#toolkit', 'Toolkit'], ['#contact', 'Contact'],
|
||||
]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user