fierce-engineer-40904
09/07/2022, 8:12 AMjs
it('Should open widget with loading state', () => {
cy.get('[data-cy="twilio-widget"]').click({ force: true })
cy.get('[data-cy="call-button"]').should('exist')
})
I would like to when I press the button, pass in the prop state of Loading to be true, so I can see the loading modal instead of my default one.
js
if (isLoading) {
return (
<Modal
isOpen={isOpen}
onClose={onClose}
size="xl"
cy-data="modal-loading"
>
<Flex direction="column" m={4}>
<Skeleton height="30px" />
<SkeletonText mt={4} />
<Skeleton height="50px" mt={4} />
<Flex justify="center" mt={4}>
<Skeleton height="50px" width="120px" />
</Flex>
</Flex>
</Modal>
)
}
Anyone know how to do that with cypress?