Testing
Test your components using TestBox.
CBWIRE includes a beautiful test API to test your front-end components quickly.
Test Example
To start, make sure you extend BaseWireTest in your test spec.
You can invoke your component by calling wire() and then chain additional state changes and assertions.
Test Methods
data
Set a data property to the specified value.
computed
Set a computed property to the specified closure.
toggle
Toggles a data property between true and false.
call
Calls an action. An optional array of parameters can be provided.
emit
Emits an event and fires any listeners that are defined on the component. An optional array of parameters can be provided, which will be passed on to listeners.
see
Verifies a value can be found in the current component rendering. Otherwise, the test fails.
dontSee
Verifies a value is not found in the current component rendering. Otherwise, the test fails.
seeData
Verifies a data property matches a specified value. Otherwise, the test fails.
dontSeeData
Verifies a data property does not match a specified value. Otherwise, test fails.