Skip to content

Commit

Permalink
chore(test): cover jsx attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
exoego committed Sep 26, 2024
1 parent f87c221 commit 336bd61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/jsx/jsx-runtime.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ describe('jsx-runtime', () => {

it('Should render HTML strings', async () => {
app.get('/', (c) => {
return c.html(<h1>Hello</h1>)
return c.html(<h1 class="hello" style={{ margin: '1px', padding: '1px' }}>Hello</h1>)
})
const res = await app.request('http://localhost/')
expect(res.status).toBe(200)
expect(res.headers.get('Content-Type')).toBe('text/html; charset=UTF-8')
expect(await res.text()).toBe('<h1>Hello</h1>')
expect(await res.text()).toBe('<h1 class="hello" style="margin:1px;padding:1px">Hello</h1>')
})

// https://en.reactjs.org/docs/jsx-in-depth.html#booleans-null-and-undefined-are-ignored
Expand Down

0 comments on commit 336bd61

Please sign in to comment.