$patch
-ing pinia store in test
#2381
-
QuestionI'm curious what the best way of awaiting a $patch change in a test to be awaited to see the component update. If I have a simple list component:
And my TestExample store initializes with a list of length 3 I can correctly assert that I see 3 checkboxes in the component.
The question I have is it appears that I can just await the $patch itself and get the same result as using Thanks in advance |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Awaiting |
Beta Was this translation helpful? Give feedback.
Awaiting
$nextTick()
is better as$patch()
doesn't return a promise, it just turns out the pending ticks, including the dom updates, are able to run.