One problem here is that you are assigning vitest methods to const variables of the same name.
Something about your code suggests Python experience to me.
JavaScript is different but similar:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment
You don't need to assign some of those vitest methods to anything, and it is my suspicion that this misconception has created your testing issues.
instead, assign the render() call to a variable, and access that variable using vitest's methods.
Well illustrated here: https://fullstackopen.com/en/part5/testing_react_apps