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';