Skip to content

Commit

Permalink
dope
Browse files Browse the repository at this point in the history
  • Loading branch information
Zizzamia committed Feb 8, 2024
1 parent 32cff76 commit 17ded0e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 21 deletions.
8 changes: 3 additions & 5 deletions src/components/FrameMetadata.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ describe('FrameMetadata', () => {

it('renders with post_url', () => {
const meta = render(
<FrameMetadata image="https://example.com/image.png" post_url="https://example.com" />,
<FrameMetadata image="https://example.com/image.png" postUrl="https://example.com" />,
);
expect(meta.container.querySelector('meta[property="fc:frame:post_url"]')).not.toBeNull();
expect(
Expand All @@ -148,9 +148,7 @@ describe('FrameMetadata', () => {
});

it('renders with refresh_period', () => {
const meta = render(
<FrameMetadata image="https://example.com/image.png" refresh_period={10} />,
);
const meta = render(<FrameMetadata image="https://example.com/image.png" refreshPeriod={10} />);
expect(meta.container.querySelector('meta[property="fc:frame:refresh_period"]')).not.toBeNull();
expect(
meta.container
Expand Down Expand Up @@ -242,7 +240,7 @@ describe('FrameMetadata', () => {
<FrameMetadata
image="image"
buttons={[{ label: 'button1', action: 'post' }]}
post_url="post_url"
postUrl="post_url"
/>,
);
expect(meta.container.querySelector('meta[property="fc:frame:button:1:target"')).toBeNull();
Expand Down
2 changes: 1 addition & 1 deletion src/components/FrameMetadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
* />
* ```
*
Expand Down
12 changes: 6 additions & 6 deletions src/core/getFrameHtmlResponse.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(`<!DOCTYPE html>
Expand Down Expand Up @@ -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('<meta property="fc:frame" content="vNext" />');
Expand All @@ -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('<meta property="fc:frame" content="vNext" />');
Expand Down Expand Up @@ -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('<meta property="fc:frame" content="vNext" />');
Expand All @@ -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('<meta property="fc:frame" content="vNext" />');
Expand Down
18 changes: 9 additions & 9 deletions src/core/getFrameMetadata.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('getFrameMetadata', () => {
{ label: 'button3' },
],
image: 'image',
post_url: 'post_url',
postUrl: 'post_url',
}),
).toEqual({
'fc:frame': 'vNext',
Expand All @@ -29,7 +29,7 @@ describe('getFrameMetadata', () => {
getFrameMetadata({
buttons: [{ label: 'button1' }],
image: 'image',
post_url: 'post_url',
postUrl: 'post_url',
}),
).toEqual({
'fc:frame': 'vNext',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand Down

0 comments on commit 17ded0e

Please sign in to comment.