Skip to content

Commit

Permalink
add test to handle empty brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
nuernbergerA committed Feb 2, 2020
1 parent 079d0d2 commit 7c8b1c5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/js/event_actions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,16 @@ test('action paramters must be separated by comma', async () => {
expect(payload.actionQueue[0].payload.params).not.toEqual(['foo', 'bar'])
})
})

test('action paramter can be empty', async () => {
var payload
mount(`<button wire:click="callSomething()"></button>`, i => payload = i)

fireEvent.click(document.querySelector('button'))

await wait(() => {
expect(payload.actionQueue[0].type).toEqual('callMethod')
expect(payload.actionQueue[0].payload.method).toEqual('callSomething')
expect(payload.actionQueue[0].payload.params).toEqual([])
})
})

0 comments on commit 7c8b1c5

Please sign in to comment.