Skip to content

Commit

Permalink
chore: up
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm committed Feb 8, 2024
1 parent 8568c14 commit f01bcf2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ const html = `
<meta property="fc:frame:post_url" content="http://localhost:3001">
<meta property="og:image" content="https://example.com/og">
`
const metaTags = htmlToMetaTags(html)
const selector = 'meta[property^="fc:"], meta[property^="og:"]'
const metaTags = htmlToMetaTags(html, selector)

test('htmlToMetaTags', () => {
const html = `
Expand All @@ -37,7 +38,7 @@ test('htmlToMetaTags', () => {
<meta property="og:image" content="https://example.com/og">
<foo>bar</foo>
`
expect(htmlToMetaTags(html).length).toEqual(2)
expect(htmlToMetaTags(html, selector).length).toEqual(2)
})

test('parseFrameProperties', () => {
Expand Down Expand Up @@ -99,7 +100,7 @@ describe('validateFrameButtons', () => {
<meta property="fc:frame:button:2" content="bar">
<meta property="fc:frame:button:3" content="baz">
`
const metaTags = htmlToMetaTags(html)
const metaTags = htmlToMetaTags(html, selector)
const buttons = parseFrameButtons(metaTags)
const result = validateFrameButtons(buttons)
expect(result).toEqual({
Expand All @@ -113,7 +114,7 @@ describe('validateFrameButtons', () => {
<meta property="fc:frame:button:1" content="foo">
<meta property="fc:frame:button:3" content="baz">
`
const metaTags = htmlToMetaTags(html)
const metaTags = htmlToMetaTags(html, selector)
const buttons = parseFrameButtons(metaTags)
const result = validateFrameButtons(buttons)
expect(result).toEqual({
Expand Down
1 change: 0 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,6 @@ function htmlToState(html: string) {
properties[property] = content
}

console.log(properties)
return {
context: deserializeJson<FrameContext>(properties['farc:context']),
previousContext: deserializeJson<PreviousFrameContext>(
Expand Down

0 comments on commit f01bcf2

Please sign in to comment.