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

Nova Unit not processing Flexible Content fields the same as when Action is run directly from Nova #55

Open
HeadStudios opened this issue Feb 1, 2023 · 0 comments

Comments

@HeadStudios
Copy link

Do you have any input on my challenge of getting different values from Whitecube Flexible Fields when running Nova Unit action tests vs. running actions from the Nova dashboard? Please find below an Issue I raised with Nova Flexible Content about this - any input you could give would be much appreciated. Thank you!

======== Reference to direct Issue: whitecube/nova-flexible-content#433
I have recently attempted to automate my Nova testing by downloading the Nova Unit Laravel extension: https://joshgaber.github.io/NovaUnit/

However I have ran into a challenge as it relates to the Nova Flexible Content - specifically the repeater fields are read differently depending on whether I am using NovaUnit's Action testing vs. executing the test through the Nova dashboard.

Below is my test for reference:
https://gist.github.com/HeadStudios/e6ed4eb3298f76447eaeca0a52c15a4c

The $opp model contains some repeater fields as per the Nova Resource definition which you can see below:
https://gist.github.com/HeadStudios/e61b4928412e2769a2eaa06df104977d

It seems that when being run from the Nova dashboard the repeater fields are returned as a string - however when run from NovaUnit the repeater fields are being returned as a collection.

When executing my action which is below:
https://gist.github.com/HeadStudios/9b089f984e8cc83bd4e0f508d63262c4

The output of the dump $opp->products repeater field content when executed from Nova Dashbord is:
https://gist.github.com/HeadStudios/77d27133e5b1e8458e8fa4a87598a729

The output of the dump $opp->products repeater field content when executed from Nova Unit is:
https://gist.github.com/HeadStudios/f1e0dba08a1ef1034a8decbf7a5f83cc

Do you have any input or suggestions on my challenge of getting different values on testing and thus being unable to perform automated Nova Action tests when the Nova Flexible Content values are involved.

Thank you!

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

No branches or pull requests

1 participant