Skip to content

Commit

Permalink
Merge branch 'main' into fix/pupil-567/bug-i-is-not-a-function
Browse files Browse the repository at this point in the history
  • Loading branch information
kimon-satan authored Apr 23, 2024
2 parents 0dfab8f + 35aee58 commit 4bff350
Show file tree
Hide file tree
Showing 29 changed files with 132 additions and 112 deletions.
18 changes: 18 additions & 0 deletions CHANGE_LOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## [1.413.4](https://github.com/oaknational/Oak-Web-Application/compare/v1.413.3...v1.413.4) (2024-04-23)

## [1.413.3](https://github.com/oaknational/Oak-Web-Application/compare/v1.413.2...v1.413.3) (2024-04-23)


### Bug Fixes

* add title to aria label ([e3a8df0](https://github.com/oaknational/Oak-Web-Application/commit/e3a8df0e9770bc67a2ae65e99a61991517fcf1a3))
* update aria label for dropdown search results ([60c5f81](https://github.com/oaknational/Oak-Web-Application/commit/60c5f81010e3c4b21f8ba35b2c384d3e195f3741))
* update aria label for single results ([d702316](https://github.com/oaknational/Oak-Web-Application/commit/d70231692cb7bb32e68885b0c34f49c637060efa))

## [1.413.2](https://github.com/oaknational/Oak-Web-Application/compare/v1.413.1...v1.413.2) (2024-04-23)


### Bug Fixes

* **analytics:** fix incorrect value for analytics bug ([e1e67c1](https://github.com/oaknational/Oak-Web-Application/commit/e1e67c1982f249760f1700e0d9b967139c6af9c7))

## [1.413.1](https://github.com/oaknational/Oak-Web-Application/compare/v1.413.0...v1.413.1) (2024-04-23)


Expand Down
2 changes: 1 addition & 1 deletion jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { jest } from "@jest/globals";
import "@testing-library/jest-dom/extend-expect";
import "@testing-library/jest-dom";
import "whatwg-fetch";
import bugsnag from "@bugsnag/js";

Expand Down
114 changes: 54 additions & 60 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@
"@storybook/nextjs": "^7.6.7",
"@storybook/react": "^7.6.7",
"@storybook/testing-library": "^0.2.2",
"@testing-library/dom": "^9.3.1",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.1.0",
"@testing-library/user-event": "^14.5.1",
"@testing-library/dom": "^10.0.0",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^15.0.2",
"@testing-library/user-event": "^14.5.2",
"@types/jest": "^29.5.8",
"@types/js-cookie": "^3.0.6",
"@types/node": "^20.10.4",
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sonar.organization=oaknational

# This is the name and version displayed in the SonarCloud UI.
sonar.projectName=Oak Web Application
sonar.projectVersion=v1.413.1
sonar.projectVersion=v1.413.4
sonar.projectDescription=Oak National Academy Web Application
sonar.links.homepage=https://www.thenational.academy/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export const getPupilPathwayData = (
lessonName: browseData.lessonData.title,
keyStageSlug: browseData.programmeFields.keystageSlug,
keyStageTitle,
subjectTitle: browseData.programmeFields.subjectDescription,
subjectTitle: browseData.programmeFields.subject,
subjectSlug: browseData.programmeFields.subjectSlug,
};
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from "react";
import "@testing-library/jest-dom/extend-expect";
import "@testing-library/jest-dom";
import { OakThemeProvider, oakDefaultTheme } from "@oaknational/oak-components";

Expand Down Expand Up @@ -156,7 +155,7 @@ describe("QuizMCQMultiAnswer", () => {
</QuizEngineContext.Provider>
</OakThemeProvider>,
);
const images = getAllByRole("img", { name: "" }); // NB. Images are currently unnamed but this will need to be replaced with alt text based search
const images = getAllByRole("presentation"); // NB. Images are currently unnamed but this will need to be replaced with alt text based search
expect(images.length).toEqual(mcqImageAnswers.length);
});
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from "react";
import "@testing-library/jest-dom/extend-expect";
import "@testing-library/jest-dom";
import { OakThemeProvider, oakDefaultTheme } from "@oaknational/oak-components";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from "react";
import "@testing-library/jest-dom/extend-expect";
import "@testing-library/jest-dom";
import { act } from "@testing-library/react";
import * as oakComponents from "@oaknational/oak-components";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from "react";
import "@testing-library/jest-dom/extend-expect";
import "@testing-library/jest-dom";
import { act } from "@testing-library/react";
import * as oakComponents from "@oaknational/oak-components";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from "react";
import "@testing-library/jest-dom/extend-expect";
import "@testing-library/jest-dom";
import { OakThemeProvider, oakDefaultTheme } from "@oaknational/oak-components";

Expand Down Expand Up @@ -36,7 +35,7 @@ describe("QuestionListItem", () => {
<QuizQuestionStem questionStem={mcqStemImage.questionStem} index={0} />
</OakThemeProvider>,
);
const image = getByRole("img");
const image = getByRole("presentation");

expect(image).toBeInTheDocument();
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from "react";
import "@testing-library/jest-dom/extend-expect";
import "@testing-library/jest-dom";
import {
OakPrimaryButton,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from "react";
import "@testing-library/jest-dom/extend-expect";
import "@testing-library/jest-dom";
import { act, fireEvent } from "@testing-library/react";
import { OakThemeProvider, oakDefaultTheme } from "@oaknational/oak-components";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from "react";
import "@testing-library/jest-dom/extend-expect";
import "@testing-library/jest-dom";
import { fireEvent } from "@testing-library/react";
import { OakThemeProvider, oakDefaultTheme } from "@oaknational/oak-components";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from "react";
import "@testing-library/jest-dom/extend-expect";
import "@testing-library/jest-dom";
import {
OakThemeProvider,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from "react";
import "@testing-library/jest-dom/extend-expect";
import "@testing-library/jest-dom";
import { OakThemeProvider, oakDefaultTheme } from "@oaknational/oak-components";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ type MiniDropDownProps = CommonButtonProps & {

const MiniDropDown = forwardRef<HTMLButtonElement, MiniDropDownProps>(
(props, ref) => {
const { onClick, icon, label, htmlButtonProps, isExpanded } = props;
const { onClick, icon, label, htmlButtonProps, isExpanded, ariaLabel } =
props;
const [textUnderline, setTextUnderline] = useState<boolean>(false);
const { isFocusVisible, focusProps } = useFocusRing();

Expand All @@ -77,7 +78,7 @@ const MiniDropDown = forwardRef<HTMLButtonElement, MiniDropDownProps>(
$color={"navy"}
onClick={onClick}
$font={"heading-7"}
aria-label={label}
aria-label={ariaLabel ?? label}
aria-expanded={isExpanded}
$ph={8}
>
Expand Down
10 changes: 5 additions & 5 deletions src/components/SharedComponents/CMSImage/CMSImage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe("CMSImage", () => {
</ThemeProvider>,
);

const img = getByRole("img");
const img = getByRole("presentation");
expect(img).toBeInTheDocument();
});

Expand Down Expand Up @@ -54,7 +54,7 @@ describe("CMSImage", () => {
const mockImage = mockImageAsset();
const { getByRole } = render(<CMSImage image={mockImage} alt="" />);

const img = getByRole("img");
const img = getByRole("presentation");
// note: `toHaveAttribute("alt", "")` returns false positives, explicitly check
expect(img.getAttribute("alt")).toBe("");
});
Expand All @@ -68,10 +68,10 @@ describe("CMSImage", () => {
};
const { getByRole, queryByRole } = render(<CMSImage image={mockImage} />);

const img = queryByRole("img");
const img = queryByRole("presentation");
expect(img).not.toBeInTheDocument();

const hiddenImg = getByRole("img", { hidden: true });
const hiddenImg = getByRole("presentation", { hidden: true });
// note: `toHaveAttribute("alt", "")` returns false positives, explicitly check
expect(hiddenImg.getAttribute("alt")).toBe("");
expect(hiddenImg).toHaveAttribute("aria-hidden", "true");
Expand All @@ -81,7 +81,7 @@ describe("CMSImage", () => {
const mockImage = mockImageAsset();
const { getByRole } = render(<CMSImage image={mockImage} />);

const img = getByRole("img");
const img = getByRole("presentation");
expect(img.getAttribute("src")).toBe(
"https://NEXT_PUBLIC_SANITY_ASSET_CDN_HOST/images/NEXT_PUBLIC_SANITY_PROJECT_ID/NEXT_PUBLIC_SANITY_DATASET/abcdef-300x300.png?w=640&h=640&fm=webp&q=80&fit=clip&auto=format",
);
Expand Down
Loading

0 comments on commit 4bff350

Please sign in to comment.