From 17ded0e8e7226be4c9f93e35ba7053e853b5d9e1 Mon Sep 17 00:00:00 2001 From: Leonardo Zizzamia Date: Thu, 8 Feb 2024 14:02:58 -0800 Subject: [PATCH] dope --- src/components/FrameMetadata.test.tsx | 8 +++----- src/components/FrameMetadata.tsx | 2 +- src/core/getFrameHtmlResponse.test.ts | 12 ++++++------ src/core/getFrameMetadata.test.ts | 18 +++++++++--------- 4 files changed, 19 insertions(+), 21 deletions(-) diff --git a/src/components/FrameMetadata.test.tsx b/src/components/FrameMetadata.test.tsx index bcd936479b..bfaeb197e0 100644 --- a/src/components/FrameMetadata.test.tsx +++ b/src/components/FrameMetadata.test.tsx @@ -138,7 +138,7 @@ describe('FrameMetadata', () => { it('renders with post_url', () => { const meta = render( - , + , ); expect(meta.container.querySelector('meta[property="fc:frame:post_url"]')).not.toBeNull(); expect( @@ -148,9 +148,7 @@ describe('FrameMetadata', () => { }); it('renders with refresh_period', () => { - const meta = render( - , - ); + const meta = render(); expect(meta.container.querySelector('meta[property="fc:frame:refresh_period"]')).not.toBeNull(); expect( meta.container @@ -242,7 +240,7 @@ describe('FrameMetadata', () => { , ); expect(meta.container.querySelector('meta[property="fc:frame:button:1:target"')).toBeNull(); diff --git a/src/components/FrameMetadata.tsx b/src/components/FrameMetadata.tsx index 2172bce776..23d300a68a 100644 --- a/src/components/FrameMetadata.tsx +++ b/src/components/FrameMetadata.tsx @@ -32,7 +32,7 @@ type FrameMetadataReact = FrameMetadataType & { * input={{ * text: 'Tell me a boat story', * }} - * post_url="https://zizzamia.xyz/api/frame" + * postUrl="https://zizzamia.xyz/api/frame" * /> * ``` * diff --git a/src/core/getFrameHtmlResponse.test.ts b/src/core/getFrameHtmlResponse.test.ts index 86d61eec08..fbf0ba4381 100644 --- a/src/core/getFrameHtmlResponse.test.ts +++ b/src/core/getFrameHtmlResponse.test.ts @@ -13,8 +13,8 @@ describe('getFrameHtmlResponse', () => { input: { text: 'Enter a message...', }, - post_url: 'https://example.com/api/frame', - refresh_period: 10, + postUrl: 'https://example.com/api/frame', + refreshPeriod: 10, }); expect(html).toBe(` @@ -80,7 +80,7 @@ describe('getFrameHtmlResponse', () => { const html = getFrameHtmlResponse({ buttons: [{ label: 'button1' }], image: 'https://example.com/image.png', - post_url: 'https://example.com/api/frame', + postUrl: 'https://example.com/api/frame', }); expect(html).toContain(''); @@ -97,7 +97,7 @@ describe('getFrameHtmlResponse', () => { it('should handle no buttons', () => { const html = getFrameHtmlResponse({ image: 'https://example.com/image.png', - post_url: 'https://example.com/api/frame', + postUrl: 'https://example.com/api/frame', }); expect(html).toContain(''); @@ -128,7 +128,7 @@ describe('getFrameHtmlResponse', () => { const html = getFrameHtmlResponse({ buttons: [{ label: 'button1' }], image: 'https://example.com/image.png', - post_url: 'https://example.com/api/frame', + postUrl: 'https://example.com/api/frame', }); expect(html).toContain(''); @@ -146,7 +146,7 @@ describe('getFrameHtmlResponse', () => { const html = getFrameHtmlResponse({ buttons: [{ label: 'button1', action: 'post' }], image: 'image', - post_url: 'post_url', + postUrl: 'post_url', }); expect(html).toContain(''); diff --git a/src/core/getFrameMetadata.test.ts b/src/core/getFrameMetadata.test.ts index bd1da0f389..b37ec77eae 100644 --- a/src/core/getFrameMetadata.test.ts +++ b/src/core/getFrameMetadata.test.ts @@ -10,7 +10,7 @@ describe('getFrameMetadata', () => { { label: 'button3' }, ], image: 'image', - post_url: 'post_url', + postUrl: 'post_url', }), ).toEqual({ 'fc:frame': 'vNext', @@ -29,7 +29,7 @@ describe('getFrameMetadata', () => { getFrameMetadata({ buttons: [{ label: 'button1' }], image: 'image', - post_url: 'post_url', + postUrl: 'post_url', }), ).toEqual({ 'fc:frame': 'vNext', @@ -44,8 +44,8 @@ describe('getFrameMetadata', () => { getFrameMetadata({ buttons: [{ label: 'button1' }], image: 'image', - post_url: 'post_url', - refresh_period: 10, + postUrl: 'post_url', + refreshPeriod: 10, }), ).toEqual({ 'fc:frame': 'vNext', @@ -64,8 +64,8 @@ describe('getFrameMetadata', () => { input: { text: 'Enter a message...', }, - post_url: 'post_url', - refresh_period: 10, + postUrl: 'post_url', + refreshPeriod: 10, }), ).toEqual({ 'fc:frame': 'vNext', @@ -85,7 +85,7 @@ describe('getFrameMetadata', () => { input: { text: 'Tell me a boat story', }, - post_url: 'https://zizzamia.xyz/api/frame', + postUrl: 'https://zizzamia.xyz/api/frame', }), ).toEqual({ 'fc:frame': 'vNext', @@ -106,7 +106,7 @@ describe('getFrameMetadata', () => { input: { text: 'Tell me a boat story', }, - post_url: 'https://zizzamia.xyz/api/frame', + postUrl: 'https://zizzamia.xyz/api/frame', }), ).toEqual({ 'fc:frame': 'vNext', @@ -124,7 +124,7 @@ describe('getFrameMetadata', () => { getFrameMetadata({ buttons: [{ label: 'button1', action: 'post' }], image: 'image', - post_url: 'post_url', + postUrl: 'post_url', }), ).toEqual({ 'fc:frame': 'vNext',