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 c19c963
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/jsx/jsx-runtime.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ 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 c19c963

Please sign in to comment.