Skip to content

Commit

Permalink
render the control in the test to ensure the library is loaded and re…
Browse files Browse the repository at this point in the history
…ndering
  • Loading branch information
lucasnetau committed Oct 17, 2023
1 parent 9806407 commit efcb38d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/control/control_plugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('Initialise Custom Control', () => {
})

describe('Test Custom Control', () => {
test('test building control element', () => {
test('test building control element', async () => {
const controlInstance = new controlStarRating({
'type': 'starRating',
'label': 'Rating',
Expand All @@ -32,5 +32,12 @@ describe('Test Custom Control', () => {
expect(element.constructor.name).toBe('HTMLInputElement')
expect(element.id).toBe('star-1492424082853')
expect(element.type).toBe('hidden')

controlInstance.on('render')(controlBuild)

await new Promise(r => setTimeout(r, 2000))

const rateYoInstance = controlBuild[1]
expect(rateYoInstance.classList.contains('jq-ry-container')).toBeTruthy()
})
})

0 comments on commit efcb38d

Please sign in to comment.