Skip to content

Commit

Permalink
fix coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
loreanvictor committed Aug 11, 2023
1 parent 6662330 commit 7999059
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/factory/test/factory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@ describe('factory', () => {
expect(document.getElementById('test')!.textContent).toBe('hellow world')
})

test('can fill DOM elements with other elements.', () => {
const factory = domFactory()
const b = document.createElement('b')
factory.fill(b, 'hellow world', factory)
expect(b.textContent).toBe('hellow world')

const span = document.createElement('span')
factory.fill(span, 'Hi Hi!', factory)
factory.fill(b, span, factory)
expect(b.textContent).toBe('Hi Hi!')
})

test('throws error for unsupported tags.', () => {
const factory = domFactory()
expect(() => factory.create(42, {}, [], factory)).toThrowError()
Expand Down

0 comments on commit 7999059

Please sign in to comment.