Skip to content

Commit

Permalink
Merge pull request #371 from xmtp-labs/dj/add-wallet
Browse files Browse the repository at this point in the history
Update Wagmi + RainbowKit Versions
  • Loading branch information
daria-github authored Sep 29, 2023
2 parents 6181fb8 + fcc8267 commit df4ba14
Show file tree
Hide file tree
Showing 27 changed files with 1,069 additions and 927 deletions.
1 change: 1 addition & 0 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ jobs:
start: npm run dev
env:
VITE_PROJECT_ID: ${{ secrets.PROJECT_ID }}
VITE_INFURA_ID: ${{ secrets.VITE_INFURA_ID }}
36 changes: 21 additions & 15 deletions cypress/e2e/connect_disconnect.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { checkElement, startDemoEnv, TIMEOUT } from "../test_utils";
import { checkElement, startDemoEnv } from "../test_utils";

describe(
"Connected Test Cases",
Expand All @@ -24,22 +24,30 @@ describe(
"collapse-icon",
"icon",
"conversation-list-header",
"new-message-icon-cta",
"conversations-list-panel",
"empty-message-icon",
"empty-message-header",
"empty-message-subheader",
"empty-message-cta",
];

elements.forEach((element) => {
checkElement(element);
});
});

it("Shows feedback convo with a preview message", () => {
checkElement("conversations-list-panel");
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(500);
cy.get(`[data-testid=message-preview-text]`, { timeout: TIMEOUT })
.first()
.should("exist");
it("Shows expected right panel fields when logged in with a connected wallet and no existing messages", () => {
const elements = [
"learn-more-header",
"get-started-header",
"message-section-link",
"message-icon",
"community-section-link",
"community-icon",
"docs-section-link",
"docs-icon",
];
elements.forEach((element) => {
checkElement(element);
});
});

it("Shows expected fields when expanding side nav while connected", () => {
Expand All @@ -61,11 +69,9 @@ describe(
cy.get(`[data-testid="disconnect-wallet-cta"]`).click();
});

it("Opens new message view when clicking on plus icon from left panel", () => {
it("Opens new message view when clicking the CTA from left panel", () => {
// Need to break up the click chain for GitHub actions
cy.get(`[data-testid=new-message-icon-cta]`).click();
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(500);
cy.get(`[data-testid=empty-message-cta]`).click();
checkElement("message-input");
});
},
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/messaging.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ describe(
});

it("Renders error message when sending message to existing user outside of XMTP network", () => {
checkElement("new-message-icon-cta");
cy.get(`[data-testid=new-message-icon-cta]`).click({ timeout: TIMEOUT });
checkElement("empty-message-cta");
cy.get(`[data-testid=empty-message-cta]`).click({ timeout: TIMEOUT });
checkElement("message-to-input").type("invalidUser", { delay: 1 });
cy.get(`[data-testid=message-to-subtext]`, { timeout: TIMEOUT }).should(
"have.text",
Expand Down
22 changes: 0 additions & 22 deletions cypress/mock_wagmi_client.ts

This file was deleted.

4 changes: 2 additions & 2 deletions cypress/test_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ export const sendAndEnterMessage = (
checkDifferentMessages = false,
) => {
cy.wait(2000);
checkElement("new-message-icon-cta");
cy.get(`[data-testid=new-message-icon-cta]`).click({ timeout: TIMEOUT });
checkElement("empty-message-cta");
cy.get(`[data-testid=empty-message-cta]`).click({ timeout: TIMEOUT });
enterWalletAddress(testUser);
checkExpectedPreMessageFields();
sendMessages(numberOfTimes, message, testUser, checkDifferentMessages);
Expand Down
Loading

1 comment on commit df4ba14

@vercel
Copy link

@vercel vercel bot commented on df4ba14 Sep 29, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.