Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passing mixed to assertVue and assertVueIsNot #853

Merged
merged 1 commit into from
Jan 18, 2021
Merged

Allow passing mixed to assertVue and assertVueIsNot #853

merged 1 commit into from
Jan 18, 2021

Conversation

adi64
Copy link
Contributor

@adi64 adi64 commented Jan 18, 2021

This addresses the issues #845 and #850.
The assertVue (and assertVueIsNot) method have a DocBlock that declared that the expected value must be of type string. However, Vue component data can contain data of any type that JavaScript supports. The PHPUnit assertEquals check also supports these types.

I often want to use assertVue to check if arrays or objects in Vue are in the desired state. So far, there are many use cases (like empty arrays, arrays with nested arrays, or objects) that are not supported yet by the available assertions in Dusk.

This PR therefore allows passing mixed values to assertVue and assertVueIsNot. The error message is now set up by JSON-encoding the expected value.

@taylorotwell taylorotwell merged commit f94a2f5 into laravel:6.x Jan 18, 2021
@adi64 adi64 deleted the assert-vue-mixed branch January 18, 2021 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants