From ae5b712024528e5884dcc6f7e2880059e464aa17 Mon Sep 17 00:00:00 2001 From: Leonardo Zizzamia Date: Wed, 7 Feb 2024 15:22:07 -0800 Subject: [PATCH] yo --- src/components/FrameMetadata.test.tsx | 69 ++++++++++++++++++++++++++- src/version.ts | 2 +- 2 files changed, 69 insertions(+), 2 deletions(-) diff --git a/src/components/FrameMetadata.test.tsx b/src/components/FrameMetadata.test.tsx index f8669691df..1a924fb338 100644 --- a/src/components/FrameMetadata.test.tsx +++ b/src/components/FrameMetadata.test.tsx @@ -29,7 +29,7 @@ describe('FrameMetadata', () => { expect(meta.container.querySelectorAll('meta').length).toBe(3); }); - it('renders with buttons', () => { + it('renders with two basic buttons', () => { const meta = render( { expect(meta.container.querySelectorAll('meta').length).toBe(5); }); + it('renders with all buttons', () => { + const meta = render( + , + ); + // Button 1 + expect(meta.container.querySelector('meta[name="fc:frame:button:1"]')).not.toBeNull(); + expect( + meta.container.querySelector('meta[name="fc:frame:button:1"]')?.getAttribute('content'), + ).toBe('button1'); + expect(meta.container.querySelector('meta[name="fc:frame:button:1:action"]')).toBeNull(); + // Button 2 + expect(meta.container.querySelector('meta[name="fc:frame:button:2"]')).not.toBeNull(); + expect( + meta.container.querySelector('meta[name="fc:frame:button:2"]')?.getAttribute('content'), + ).toBe('button2'); + expect(meta.container.querySelector('meta[name="fc:frame:button:2:action"]')).not.toBeNull(); + expect( + meta.container + .querySelector('meta[name="fc:frame:button:2:action"]') + ?.getAttribute('content'), + ).toBe('post_redirect'); + // Button 3 + expect(meta.container.querySelector('meta[name="fc:frame:button:3"]')).not.toBeNull(); + expect( + meta.container.querySelector('meta[name="fc:frame:button:3"]')?.getAttribute('content'), + ).toBe('button3'); + expect(meta.container.querySelector('meta[name="fc:frame:button:3:action"]')).not.toBeNull(); + expect( + meta.container + .querySelector('meta[name="fc:frame:button:3:action"]') + ?.getAttribute('content'), + ).toBe('mint'); + expect(meta.container.querySelector('meta[name="fc:frame:button:3:target"]')).not.toBeNull(); + expect( + meta.container + .querySelector('meta[name="fc:frame:button:3:target"]') + ?.getAttribute('content'), + ).toBe('https://zizzamia.xyz/api/frame/mint'); + // Button 4 + expect(meta.container.querySelector('meta[name="fc:frame:button:4"]')).not.toBeNull(); + expect( + meta.container.querySelector('meta[name="fc:frame:button:4"]')?.getAttribute('content'), + ).toBe('button4'); + expect(meta.container.querySelector('meta[name="fc:frame:button:4:action"]')).not.toBeNull(); + expect( + meta.container + .querySelector('meta[name="fc:frame:button:4:action"]') + ?.getAttribute('content'), + ).toBe('link'); + expect(meta.container.querySelector('meta[name="fc:frame:button:4:target"]')).not.toBeNull(); + expect( + meta.container + .querySelector('meta[name="fc:frame:button:4:target"]') + ?.getAttribute('content'), + ).toBe('https://zizzamia.xyz/api/frame/link'); + // Length + expect(meta.container.querySelectorAll('meta').length).toBe(11); + }); + it('renders with post_url', () => { const meta = render( , diff --git a/src/version.ts b/src/version.ts index 922904388b..1a152b3ce4 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const version = '0.5.1'; +export const version = '0.5.2';