Skip to content

Commit

Permalink
EAR-1378-review-dependabots-52 (#2083)
Browse files Browse the repository at this point in the history
* Bump js-yaml from 4.0.0 to 4.1.0 in /eq-author-api

Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/nodeca/js-yaml/releases)
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](nodeca/js-yaml@4.0.0...4.1.0)

Signed-off-by: dependabot[bot] <[email protected]>

* Bump chalk from 4.1.0 to 4.1.1 in /eq-author-api

Bumps [chalk](https://github.com/chalk/chalk) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/chalk/chalk/releases)
- [Commits](chalk/chalk@v4.1.0...v4.1.1)

Signed-off-by: dependabot[bot] <[email protected]>

* Bump helmet from 4.5.0 to 4.6.0 in /eq-publisher

Bumps [helmet](https://github.com/helmetjs/helmet) from 4.5.0 to 4.6.0.
- [Release notes](https://github.com/helmetjs/helmet/releases)
- [Changelog](https://github.com/helmetjs/helmet/blob/main/CHANGELOG.md)
- [Commits](helmetjs/helmet@v4.5.0...v4.6.0)

Signed-off-by: dependabot[bot] <[email protected]>

* Bump chalk from 4.1.0 to 4.1.1 in /eq-author

Bumps [chalk](https://github.com/chalk/chalk) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/chalk/chalk/releases)
- [Commits](chalk/chalk@v4.1.0...v4.1.1)

Signed-off-by: dependabot[bot] <[email protected]>

* Bump helmet from 4.5.0 to 4.6.0 in /eq-author-api

Bumps [helmet](https://github.com/helmetjs/helmet) from 4.5.0 to 4.6.0.
- [Release notes](https://github.com/helmetjs/helmet/releases)
- [Changelog](https://github.com/helmetjs/helmet/blob/main/CHANGELOG.md)
- [Commits](helmetjs/helmet@v4.5.0...v4.6.0)

Signed-off-by: dependabot[bot] <[email protected]>

* Bump cheerio from 1.0.0-rc.6 to 1.0.0-rc.9 in /eq-publisher

Bumps [cheerio](https://github.com/cheeriojs/cheerio) from 1.0.0-rc.6 to 1.0.0-rc.9.
- [Release notes](https://github.com/cheeriojs/cheerio/releases)
- [Changelog](https://github.com/cheeriojs/cheerio/blob/main/History.md)
- [Commits](cheeriojs/cheerio@v1.0.0-rc.6...v1.0.0-rc.9)

Signed-off-by: dependabot[bot] <[email protected]>

* Updated import declaration for cheerio

* Bump dotenv from 8.2.0 to 10.0.0 in /eq-author-api

Bumps [dotenv](https://github.com/motdotla/dotenv) from 8.2.0 to 10.0.0.
- [Release notes](https://github.com/motdotla/dotenv/releases)
- [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md)
- [Commits](motdotla/dotenv@v8.2.0...v10.0.0)

Signed-off-by: dependabot[bot] <[email protected]>

* Bump firebase-admin from 9.6.0 to 9.9.0 in /eq-author-api

Bumps [firebase-admin](https://github.com/firebase/firebase-admin-node) from 9.6.0 to 9.9.0.
- [Release notes](https://github.com/firebase/firebase-admin-node/releases)
- [Commits](firebase/firebase-admin-node@v9.6.0...v9.9.0)

Signed-off-by: dependabot[bot] <[email protected]>

* Bump apollo-server-express from 2.23.0 to 2.25.0 in /eq-author-api

Bumps [apollo-server-express](https://github.com/apollographql/apollo-server/tree/HEAD/packages/apollo-server-express) from 2.23.0 to 2.25.0.
- [Release notes](https://github.com/apollographql/apollo-server/releases)
- [Changelog](https://github.com/apollographql/apollo-server/blob/main/CHANGELOG.md)
- [Commits](https://github.com/apollographql/apollo-server/commits/[email protected]/packages/apollo-server-express)

Signed-off-by: dependabot[bot] <[email protected]>

* Bump react-tooltip from 4.0.3 to 4.2.21 in /eq-author

Bumps [react-tooltip](https://github.com/wwayne/react-tooltip) from 4.0.3 to 4.2.21.
- [Release notes](https://github.com/wwayne/react-tooltip/releases)
- [Changelog](https://github.com/wwayne/react-tooltip/blob/master/CHANGELOG.md)
- [Commits](ReactTooltip/react-tooltip@v4.0.3...v4.2.21)

Signed-off-by: dependabot[bot] <[email protected]>

* Updated snapshots for react-tooltip

* Bump prettier from 2.2.1 to 2.3.1

Bumps [prettier](https://github.com/prettier/prettier) from 2.2.1 to 2.3.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](prettier/prettier@2.2.1...2.3.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Updated snapshots for prettier

* Bump eslint from 7.25.0 to 7.28.0 in /eq-publisher

Bumps [eslint](https://github.com/eslint/eslint) from 7.25.0 to 7.28.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](eslint/eslint@v7.25.0...v7.28.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump jest from 26.6.3 to 27.0.4 in /eq-publisher

Bumps [jest](https://github.com/facebook/jest) from 26.6.3 to 27.0.4.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md)
- [Commits](jestjs/jest@v26.6.3...v27.0.4)

---
updated-dependencies:
- dependency-name: jest
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump ioredis from 4.27.1 to 4.27.5 in /eq-author-api

Bumps [ioredis](https://github.com/luin/ioredis) from 4.27.1 to 4.27.5.
- [Release notes](https://github.com/luin/ioredis/releases)
- [Changelog](https://github.com/luin/ioredis/blob/master/Changelog.md)
- [Commits](redis/ioredis@v4.27.1...v4.27.5)

---
updated-dependencies:
- dependency-name: ioredis
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Updated snapshots

* updated the snaps

* fixed DC

* Updated snapshots

* Update snapshots

* Refactor failing snapshot tests

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: jasehumphr <[email protected]>
Co-authored-by: Matthew Elcock <[email protected]>
Co-authored-by: Thomas Baggaley <[email protected]>
  • Loading branch information
5 people authored Jun 14, 2021
1 parent 6fa11be commit c395e6f
Show file tree
Hide file tree
Showing 13 changed files with 1,347 additions and 3,628 deletions.
2 changes: 1 addition & 1 deletion eq-author-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"dynamoose": "latest",
"express": "latest",
"express-pino-logger": "latest",
"firebase-admin": "^9.6.0",
"firebase-admin": "^9.9.0",
"graphql": "latest",
"graphql-anywhere": "latest",
"graphql-iso-date": "latest",
Expand Down
389 changes: 242 additions & 147 deletions eq-author-api/yarn.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ describe("Option", () => {
};

beforeEach(() => {

mockEvent = {
stopPropagation: jest.fn(),
preventDefault: jest.fn(),
Expand All @@ -64,13 +63,18 @@ describe("Option", () => {
render();
});

it("should match snapshot", () => {
expect(wrapper).toMatchSnapshot();
it("should render a radio button with dummy radio styling", () => {
render(rtlRender);
expect(screen.queryByTestId("dummy-multiple-choice")).toHaveStyle({
"border-radius": "100%",
});
});

it("should render a checkbox", () => {
render(mount, { type: CHECKBOX });
expect(wrapper).toMatchSnapshot();
it("should render a checkbox with dummy checkbox styling", () => {
render(rtlRender, { type: CHECKBOX });
expect(screen.queryByTestId("dummy-multiple-choice")).toHaveStyle({
"border-radius": "4px",
});
});

it("shouldn't render delete button if not applicable", () => {
Expand All @@ -79,12 +83,16 @@ describe("Option", () => {
});

it("should call onChange and onBlur correctly", () => {
const { getByTestId } = rtlRender(( otherProps) => <StatelessOption {...mockMutations}
option={option}
hasDeleteButton
type={RADIO}
{...otherProps}
{...props} />);
const { getByTestId } = rtlRender((otherProps) => (
<StatelessOption
{...mockMutations}
option={option}
hasDeleteButton
type={RADIO}
{...otherProps}
{...props}
/>
));

fireEvent.change(getByTestId("option-label"), {
target: { value: "2" },
Expand All @@ -93,15 +101,13 @@ describe("Option", () => {
expect(mockMutations.onUpdate).toHaveBeenCalledTimes(1);
});

it("should call onChange on input", async() => {
it("should call onChange on input", async () => {
render(rtlRender, { type: CHECKBOX });
fireEvent.change(screen.getByTestId("other-answer"), {
target: { value: "use this text" },
});
});

expect(
screen.getByText(/use this text/)
).toBeInTheDocument();
expect(screen.getByText(/use this text/)).toBeInTheDocument();
});

it("should update label on blur", () => {
Expand All @@ -114,21 +120,18 @@ describe("Option", () => {

it("should update Other Answer on blur", () => {
const handleSaveOtherLabel = jest.fn();
useMutation.mockImplementation(() => [
handleSaveOtherLabel
])
useMutation.mockImplementation(() => [handleSaveOtherLabel]);
render(rtlRender, { type: CHECKBOX });
fireEvent.change(screen.getByTestId("other-answer"), {
target: { value: "2" },
});
fireEvent.blur(screen.getByTestId("other-answer"),);
fireEvent.blur(screen.getByTestId("other-answer"));
expect(handleSaveOtherLabel).toHaveBeenCalledTimes(1);

});

it("should invoke onDelete callback when option deleted", () => {
render(rtlRender, { type: CHECKBOX });
fireEvent.click(screen.getByTestId("btn-delete-option"),);
fireEvent.click(screen.getByTestId("btn-delete-option"));

expect(mockMutations.onDelete).toHaveBeenCalledWith(option.id);
});
Expand Down
Loading

0 comments on commit c395e6f

Please sign in to comment.