diff --git a/src/core/getFrameHtmlResponse.test.ts b/src/core/getFrameHtmlResponse.test.ts index edc77fdbf4..e3a4dd6870 100644 --- a/src/core/getFrameHtmlResponse.test.ts +++ b/src/core/getFrameHtmlResponse.test.ts @@ -246,6 +246,29 @@ describe('getFrameHtmlResponse', () => { expect(html).toContain(''); expect(html).toContain(''); }); + + it('should set a button link only once', () => { + const html = getFrameHtmlResponse({ + buttons: [{ label: 'button1', action: 'link', target: 'https://example.com' }], + image: 'image', + postUrl: 'post_url', + }); + + expect(html).toContain(''); + expect(html).toContain(''); + expect(html).toContain( + '', + ); + expect(html).not.toContain('fc:frame:button:2'); + expect(html).not.toContain('fc:frame:button:2:action'); + expect(html).not.toContain('fc:frame:button:2:target'); + expect(html).not.toContain('fc:frame:button:3'); + expect(html).not.toContain('fc:frame:button:3:action'); + expect(html).not.toContain('fc:frame:button:3:target'); + expect(html).not.toContain('fc:frame:button:4'); + expect(html).not.toContain('fc:frame:button:4:action'); + expect(html).not.toContain('fc:frame:button:4:target'); + }); }); export { getFrameHtmlResponse };