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
44 changes: 44 additions & 0 deletions services/main-frontend/src/pages/account-deleted.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { css } from "@emotion/css"
import { Envelope } from "@vectopus/atlas-icons-react"
import Link from "next/link"
import { useTranslation } from "react-i18next"

import Button from "@/shared-module/common/components/Button"
import { baseTheme } from "@/shared-module/common/styles"

const AccountDeletedPage: React.FC = () => {
const { t } = useTranslation()
return (
<>
<div
className={css`
background-color: ${baseTheme.colors.green[100]};
padding: 3rem;
margin-bottom: 1rem;

h1 {
font-size: 2rem;
}
`}
>
<h1>
<Envelope
className={css`
color: ${baseTheme.colors.green[500]};
margin-right: 0.5rem;
`}
/>
Comment on lines +25 to +30
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add aria-hidden="true" to decorative icon.

The Envelope icon is decorative within the heading. For better accessibility, mark it as hidden from screen readers since the text already conveys the meaning.

🔎 Apply this diff:
         <Envelope
+          aria-hidden="true"
           className={css`
             color: ${baseTheme.colors.green[500]};
             margin-right: 0.5rem;
           `}
         />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Envelope
className={css`
color: ${baseTheme.colors.green[500]};
margin-right: 0.5rem;
`}
/>
<Envelope
aria-hidden="true"
className={css`
color: ${baseTheme.colors.green[500]};
margin-right: 0.5rem;
`}
/>
🤖 Prompt for AI Agents
In services/main-frontend/src/pages/account-deleted.tsx around lines 25 to 30,
the Envelope icon is decorative but not hidden from assistive technology; add
aria-hidden="true" to the Envelope component (or role="presentation") so screen
readers ignore it while keeping the visible markup unchanged.

{t("message-your-account-has-been-deleted")}
</h1>
</div>

<Link href="/">
<Button size="medium" variant="primary">
{t("home-page")}
</Button>
</Link>
</>
)
}

export default AccountDeletedPage
16 changes: 12 additions & 4 deletions system-tests/src/tests/chatbot-conversation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,12 @@ test.describe("Test chatbot chat box", () => {
waitForTheseToBeVisibleAndStable: [textInPopover],
beforeScreenshot: async () => {
// Scroll position of the messages container is unstable when resizing the browser window for the mobile screenshot, so we close the popover so that we can scroll, scroll the container to the bottom and open the popover again.
await student1Page.locator("body").press("Escape")
await textInPopover.waitFor({ state: "hidden" })
await expect(async () => {
await student1Page.locator("body").press("Escape")
await expect(textInPopover).toBeHidden({ timeout: 2000 })
}).toPass({
timeout: 15000,
})
await scrollElementContainerToTop(citation1)
await citation1.click()
await textInPopover.waitFor()
Expand Down Expand Up @@ -193,8 +197,12 @@ test.describe("Test chatbot chat box", () => {
waitForTheseToBeVisibleAndStable: [textInPopover],
beforeScreenshot: async () => {
// Scroll position of the messages container is unstable when resizing the browser window for the mobile screenshot, so we close the popover so that we can scroll, scroll the container to the bottom and open the popover again.
await student1Page.locator("body").press("Escape")
await textInPopover.waitFor({ state: "hidden" })
await expect(async () => {
await student1Page.locator("body").press("Escape")
await expect(textInPopover).toBeHidden({ timeout: 2000 })
}).toPass({
timeout: 15000,
})
await scrollElementContainerToTop(citation1)
await citation1.click()
await textInPopover.waitFor()
Expand Down
5 changes: 4 additions & 1 deletion system-tests/src/tests/draft.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ test.describe("Teacher", () => {
test("Can give students access to the draft course", async ({ page, browser }) => {
await page.goto("http://project-331.local/organizations")
await selectOrganization(page, "University of Helsinki, Department of Computer Science")
await page.getByRole("button", { name: "Create" }).first().click()
await page
.getByRole("region", { name: "Courses:" })
.getByRole("button", { name: "Create", exact: true })
.click()
await page.getByLabel("Name *", { exact: true }).fill("Best draft course")
await page.getByLabel("Teacher in charge name *").fill("Draft Teacher")
await page.getByLabel("Teacher in charge email *").fill("draft@example.com")
Expand Down
Loading