How to Unit Test dom whose v-if is false by vue

for example, there is a button:
whose evaluation property in v-if returns false (the evaluation property does not have a setter).
so how to trigger the click event of the button through wrapper in the unit test. (button is not rendered at all, and the calculation property cannot be changed to true without setter.)
the temporary idea is to replace it with v-show

.
Jun.10,2022
Although

has not been practiced, I think the idea should be in the unit test file. First, set the value of the v-if bound data to true, and let him render the tag in the template before testing. My assumption is that since unit tests can be introduced into view components, it should be feasible to modify the values in them.


if you just want to detect the logic of a method, you can call the method directly with vm, not necessarily with dom.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e88ef9-46cf2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e88ef9-46cf2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?