Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mui5 #1550

Closed
wants to merge 51 commits into from
Closed

Mui5 #1550

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
38905ef
build: yarn add @mui/material @mui/styles ; yarn add @mui/lab ; yarn …
timheilman Mar 5, 2024
852d25d
build: yarn add @emotion/react @emotion/styled
timheilman Mar 5, 2024
552005b
build: npx @mui/codemod@latest v5.0.0/preset-safe src
timheilman Mar 5, 2024
885352d
build: empty commit, for: npx @mui/codemod@latest v5.0.0/variant-prop…
timheilman Mar 5, 2024
05c230b
build: npx @mui/codemod@latest v5.0.0/link-underline-hover src
timheilman Mar 5, 2024
4a5cb7b
build: npx prettier --write src backend cypress scripts
timheilman Mar 5, 2024
3003c65
build: yarn remove @material-ui/core @material-ui/icons @material-ui/lab
timheilman Mar 5, 2024
dce9fb2
build: rm patches/@material-ui+core+4.12.4.patch
timheilman Mar 5, 2024
5f859b5
build: update renovate.json to use @mui not @material-ui
timheilman Mar 5, 2024
76941ab
build: update ThemeProvider import, per
timheilman Mar 5, 2024
84b79d2
build: update EventType for Tabs onChange event, per
timheilman Mar 5, 2024
622f88e
fix: Two tabs problems:
timheilman Mar 5, 2024
17b7ab2
fix: transaction amount was falling off right edge
timheilman Mar 6, 2024
5909365
fix: indirection of onChange prop of Slider via ownerState
timheilman Mar 6, 2024
ea9a4a6
fix: remove zIndex from AppBar to fix drawer issue
timheilman Mar 6, 2024
87d2c83
build: npx @mui/codemod@latest v5.0.0/jss-to-styled src/containers
timheilman Mar 6, 2024
ae8dba8
build: npx @mui/codemod@latest v5.0.0/jss-to-styled src/components/Ba…
timheilman Mar 6, 2024
f6c29f3
build: npx @mui/codemod@latest v5.0.0/jss-to-styled src/components/Co…
timheilman Mar 6, 2024
d4983cb
build: npx @mui/codemod@latest v5.0.0/jss-to-styled src/components/Ma…
timheilman Mar 6, 2024
3990f9d
build: npx @mui/codemod@latest v5.0.0/jss-to-styled src/components/Na…
timheilman Mar 7, 2024
ba97456
build: npx @mui/codemod@latest v5.0.0/jss-to-styled src/components/Na…
timheilman Mar 7, 2024
53b69c5
build: npx @mui/codemod@latest v5.0.0/jss-to-styled src/components/No…
timheilman Mar 7, 2024
b9a736b
build: npx @mui/codemod@latest v5.0.0/jss-to-styled src/components/S…
timheilman Mar 7, 2024
8887694
build: npx @mui/codemod@latest v5.0.0/jss-to-styled src/components/S…
timheilman Mar 7, 2024
ebe6f1a
build: npx @mui/codemod@latest v5.0.0/jss-to-styled src/components/Sk…
timheilman Mar 7, 2024
b213b91
build: npx @mui/codemod@latest v5.0.0/jss-to-styled src/components/Tr…
timheilman Mar 7, 2024
7f9595c
build: npx @mui/codemod@latest v5.0.0/jss-to-styled src/components/Tr…
timheilman Mar 7, 2024
7e0ba7e
build: npx @mui/codemod@latest v5.0.0/jss-to-styled src/components/Tr…
timheilman Mar 7, 2024
e5498e0
build: npx @mui/codemod@latest v5.0.0/jss-to-styled src/components/Tr…
timheilman Mar 7, 2024
b6c0ab6
build: npx @mui/codemod@latest v5.0.0/jss-to-styled src/components/Tr…
timheilman Mar 7, 2024
87feb2d
build: npx @mui/codemod@latest v5.0.0/jss-to-styled src/components/Tr…
timheilman Mar 7, 2024
9925dca
build: npx @mui/codemod@latest v5.0.0/jss-to-styled src/components/Tr…
timheilman Mar 7, 2024
9509c70
build: npx @mui/codemod@latest v5.0.0/jss-to-styled src/components/Tr…
timheilman Mar 7, 2024
e322576
build: npx @mui/codemod@latest v5.0.0/jss-to-styled src/components/Tr…
timheilman Mar 7, 2024
f836550
build: npx @mui/codemod@latest v5.0.0/jss-to-styled src/components/Tr…
timheilman Mar 7, 2024
459dc56
build: npx @mui/codemod@latest v5.0.0/jss-to-styled src/components/Tr…
timheilman Mar 7, 2024
11a6417
build: npx @mui/codemod@latest v5.0.0/jss-to-styled src/components/Us…
timheilman Mar 7, 2024
7d16340
build: npx @mui/codemod@latest v5.0.0/jss-to-styled src/components
timheilman Mar 7, 2024
756a0f4
build: yarn remove @mui/styles and some
timheilman Mar 7, 2024
c18c08a
fix: oops did not mean to modify database.json
timheilman Mar 8, 2024
c009da8
Merge branch 'develop' into build/upgrade-mui-v4-to-v5
timheilman May 16, 2024
a237f2c
build: remove @ts-expect-error annotations no longer used after yarn.…
timheilman May 16, 2024
3a20270
test: issue 1278 re-enabling test that had failed on firefox,
timheilman May 16, 2024
6e2e96b
style: npm run prettier
timheilman May 16, 2024
0064916
Merge remote-tracking branch 'origin/develop' into build/upgrade-mui-…
timheilman Jun 9, 2024
2879b64
fix: unset flex-direction which is newly set to row-reverse for
timheilman Jun 9, 2024
c01fddf
fix: undo parent commit fix because avatars were backward and
timheilman Jun 10, 2024
cd6c00b
fix: get body font size back down to 14, establish knobs for
timheilman Jun 10, 2024
8c67acb
Merge remote-tracking branch 'origin/develop' into build/upgrade-mui-…
timheilman Jun 29, 2024
64224dd
test: apply force:true to clicks failing due to issue #29776
timheilman Jun 29, 2024
5fcfe43
Merge branch 'develop' of github.com:cypress-io/cypress-realworld-app…
AtofStryker Aug 26, 2024
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: 3 additions & 9 deletions backend/graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,8 @@ type Query {
}

type Mutation {
createBankAccount(
bankName: String!,
accountNumber: String!,
routingNumber: String!
): BankAccount
deleteBankAccount(
id: ID!
): Boolean
createBankAccount(bankName: String!, accountNumber: String!, routingNumber: String!): BankAccount
deleteBankAccount(id: ID!): Boolean
}

type BankAccount {
Expand All @@ -23,4 +17,4 @@ type BankAccount {
isDeleted: Boolean
createdAt: String
modifiedAt: String
}
}
1 change: 1 addition & 0 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ Cypress.Commands.add("setTransactionAmountRange", (min, max) => {
.getBySelLike("filter-amount-range-slider")
.reactComponent()
.its("memoizedProps")
.its("ownerState")
.invoke("onChange", null, [min / 10, max / 10]);
});

Expand Down
10 changes: 4 additions & 6 deletions cypress/support/component-index.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title>Components App</title>

</head>
<body>

<div data-cy-root></div>
</body>
</html>
110 changes: 52 additions & 58 deletions cypress/tests/ui/notifications.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,65 +26,59 @@ describe("Notifications", function () {
});

describe("notifications from user interactions", function () {
it(
"User A likes a transaction of User B; User B gets notification that User A liked transaction ",
// NOTE: this test seems to have issues in Firefox UI/Mobile tests due to an issue with the Base Button component in MUI v4
// we should try unskipping this test in Firefox once we upgrade MUI to v5+. @see https://github.com/cypress-io/cypress-realworld-app/issues/1278
{ browser: { name: "!firefox" } },
function () {
cy.loginByXstate(ctx.userA.username);
cy.wait("@getNotifications");

cy.database("find", "transactions", { senderId: ctx.userB.id }).then(
(transaction: Transaction) => {
cy.visit(`/transaction/${transaction.id}`);
}
);

cy.log("🚩 Renders the notifications badge with count");
cy.wait("@getNotifications")
.its("response.body.results.length")
.then((notificationCount) => {
cy.getBySel("nav-top-notifications-count").should("have.text", `${notificationCount}`);
});
cy.visualSnapshot("Renders the notifications badge with count");

const likesCountSelector = "[data-test*=transaction-like-count]";
cy.contains(likesCountSelector, 0);
cy.getBySelLike("like-button").click();
// a successful "like" should disable the button and increment
// the number of likes
cy.getBySelLike("like-button").should("be.disabled");
cy.contains(likesCountSelector, 1);
cy.visualSnapshot("Like Count Incremented");

cy.switchUserByXstate(ctx.userB.username);
cy.visualSnapshot(`Switch to User ${ctx.userB.username}`);

cy.wait("@getNotifications")
.its("response.body.results.length")
.as("preDismissedNotificationCount");

cy.visit("/notifications");

cy.wait("@getNotifications");

cy.getBySelLike("notification-list-item")
.should("have.length", 9)
.first()
.should("contain", ctx.userA?.firstName)
.and("contain", "liked");

cy.log("🚩 Marks notification as read");
cy.getBySelLike("notification-mark-read").first().click({ force: true });
cy.wait("@updateNotification");

cy.get("@preDismissedNotificationCount").then((count) => {
cy.getBySelLike("notification-list-item").should("have.length.lessThan", Number(count));
it("User A likes a transaction of User B; User B gets notification that User A liked transaction ", function () {
cy.loginByXstate(ctx.userA.username);
cy.wait("@getNotifications");

cy.database("find", "transactions", { senderId: ctx.userB.id }).then(
(transaction: Transaction) => {
cy.visit(`/transaction/${transaction.id}`);
}
);

cy.log("🚩 Renders the notifications badge with count");
cy.wait("@getNotifications")
.its("response.body.results.length")
.then((notificationCount) => {
cy.getBySel("nav-top-notifications-count").should("have.text", `${notificationCount}`);
});
cy.visualSnapshot("Notification count after notification dismissed");
}
);
cy.visualSnapshot("Renders the notifications badge with count");

const likesCountSelector = "[data-test*=transaction-like-count]";
cy.contains(likesCountSelector, 0);
cy.getBySelLike("like-button").click();
// a successful "like" should disable the button and increment
// the number of likes
cy.getBySelLike("like-button").should("be.disabled");
cy.contains(likesCountSelector, 1);
cy.visualSnapshot("Like Count Incremented");

cy.switchUserByXstate(ctx.userB.username);
cy.visualSnapshot(`Switch to User ${ctx.userB.username}`);

cy.wait("@getNotifications")
.its("response.body.results.length")
.as("preDismissedNotificationCount");

cy.visit("/notifications");

cy.wait("@getNotifications");

cy.getBySelLike("notification-list-item")
.should("have.length", 9)
.first()
.should("contain", ctx.userA?.firstName)
.and("contain", "liked");

cy.log("🚩 Marks notification as read");
cy.getBySelLike("notification-mark-read").first().click({ force: true });
cy.wait("@updateNotification");

cy.get("@preDismissedNotificationCount").then((count) => {
cy.getBySelLike("notification-list-item").should("have.length.lessThan", Number(count));
});
cy.visualSnapshot("Notification count after notification dismissed");
});

it("User C likes a transaction between User A and User B; User A and User B get notifications that User C liked transaction", function () {
cy.loginByXstate(ctx.userC.username);
Expand Down
9 changes: 6 additions & 3 deletions cypress/tests/ui/transaction-view.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,17 @@ describe("Transaction View", function () {
});

it("transactions navigation tabs are hidden on a transaction view page", function () {
cy.getBySelLike("transaction-item").first().click();
// { force: true } is a workaround for https://github.com/cypress-io/cypress/issues/29776
cy.getBySelLike("transaction-item").first().click({ force: true });
cy.location("pathname").should("include", "/transaction");
cy.getBySel("nav-transaction-tabs").should("not.exist");
cy.getBySel("transaction-detail-header").should("be.visible");
cy.visualSnapshot("Transaction Navigation Tabs Hidden");
});

it("likes a transaction", function () {
cy.getBySelLike("transaction-item").first().click();
// { force: true } is a workaround for https://github.com/cypress-io/cypress/issues/29776
cy.getBySelLike("transaction-item").first().click({ force: true });
cy.wait("@getTransaction");

cy.getBySelLike("like-button").click();
Expand All @@ -58,7 +60,8 @@ describe("Transaction View", function () {
});

it("comments on a transaction", function () {
cy.getBySelLike("transaction-item").first().click();
// { force: true } is a workaround for https://github.com/cypress-io/cypress/issues/29776
cy.getBySelLike("transaction-item").first().click({ force: true });
cy.wait("@getTransaction");

const comments = ["Thank you!", "Appreciate it."];
Expand Down
4 changes: 2 additions & 2 deletions cypress/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"lib": ["es2015", "dom"],
"isolatedModules": false,
"allowJs": true,
"noEmit": true
}
"noEmit": true,
},
}
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
"@babel/core": "7.23.9",
"@babel/plugin-syntax-flow": "^7.14.5",
"@babel/plugin-transform-react-jsx": "^7.14.9",
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.0",
"@graphql-tools/graphql-file-loader": "7.5.17",
"@graphql-tools/load": "7.8.14",
"@material-ui/core": "4.12.4",
"@material-ui/icons": "4.11.3",
"@material-ui/lab": "4.0.0-alpha.61",
"@matheusluizn/react-google-login": "^5.1.6",
"@mui/icons-material": "^5.15.12",
"@mui/lab": "^5.0.0-alpha.167",
"@mui/material": "^5.15.12",
"@okta/jwt-verifier": "^3.0.1",
"@okta/okta-auth-js": "^7.3.0",
"@okta/okta-react": "^6.7.0",
Expand Down
103 changes: 0 additions & 103 deletions patches/@material-ui+core+4.12.4.patch

This file was deleted.

2 changes: 1 addition & 1 deletion renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
},
{
"groupName": "Material UI",
"matchPackagePatterns": ["^@material-ui/"]
"matchPackagePatterns": ["^@mui/"]
},
{
"groupName": "Graphql",
Expand Down
4 changes: 2 additions & 2 deletions scripts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"exclude": [],
"compilerOptions": {
"types": ["node"],
"isolatedModules": false
}
"isolatedModules": false,
},
}
4 changes: 2 additions & 2 deletions src/components/AlertBar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { Snackbar } from "@material-ui/core";
import { Snackbar } from "@mui/material";
import {
BaseActionObject,
Interpreter,
Expand All @@ -9,7 +9,7 @@ import {
} from "xstate";
import { SnackbarContext, SnackbarSchema, SnackbarEvents } from "../machines/snackbarMachine";
import { useActor } from "@xstate/react";
import { Alert } from "@material-ui/lab";
import { Alert } from "@mui/material";

interface Props {
snackbarService: Interpreter<
Expand Down
Loading