Skip to content

Commit

Permalink
Add E2E frames test for V3 (#753)
Browse files Browse the repository at this point in the history
  • Loading branch information
rygine authored Dec 16, 2024
1 parent 8120a39 commit 167ec68
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/frames-client/src/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const getV3Setup = async () => {
getBytes(await wallet.signMessage(message)),
},
encryptionKey,
{ env: "local" },
{ env: "dev" },
);
const signer: V3FramesSigner = {
address: () => client.accountAddress,
Expand Down Expand Up @@ -133,7 +133,7 @@ const shouldSignFrameActionWithValidSignature =
// Will add E2E tests back once we have Frames deployed with the new schema
const worksE2E = (framesClient: FramesClient) => async () => {
const frameUrl =
"https://fc-polls-five.vercel.app/polls/03710836-bc1d-4921-9e24-89d82015c53b";
"https://fc-polls-five.vercel.app/polls/03710836-bc1d-4921-9e24-89d82015c53b?env=dev";
const metadata = await framesClient.proxy.readMetadata(frameUrl);
expect(metadata).toBeDefined();
expect(metadata.frameInfo).toMatchObject({
Expand All @@ -153,7 +153,7 @@ const worksE2E = (framesClient: FramesClient) => async () => {
"https://fc-polls-five.vercel.app/api/image?id=03710836-bc1d-4921-9e24-89d82015c53b",
},
postUrl:
"https://fc-polls-five.vercel.app/api/vote?id=03710836-bc1d-4921-9e24-89d82015c53b",
"https://fc-polls-five.vercel.app/api/vote?id=03710836-bc1d-4921-9e24-89d82015c53b&env=dev",
});
const signedPayload = await framesClient.signFrameAction({
frameUrl,
Expand Down Expand Up @@ -226,6 +226,11 @@ describe("FramesClient", () => {
await shouldSignFrameActionWithValidSignature(signer, framesClient)();
});

it("works e2e", async () => {
const { framesClient } = await getV3Setup();
await worksE2E(framesClient)();
});

it("sends back the button postUrl for a tx frame in frame info", async () => {
const { framesClient } = await getV3Setup();
await sendsBackButtonPostUrl(framesClient)();
Expand Down

0 comments on commit 167ec68

Please sign in to comment.