Closed as not planned
Description
Current behavior
I got type error reading a React local state during test run because state is undefined. If I repeat the steps manually the state keeps the proper value.
This test and source code was working fine with the previous cypress version (7.5.0)
Desired behavior
It should keep the state value of the component.
Test code to reproduce
code snippet:
const [currentContent, setCurrentContent] = useState<GenericContent>() --> the state
useEffect(() => {
async function getCurrentContent() {
const result = await repo.load({
idOrPath: props.contentPath,
})
setCurrentContent(result.d) --> here we set the value (it is OK)
}
getCurrentContent()
}, [props.contentPath, repo])
const selectMemberFunction = (newEntry: EntryType) => {
if (permissions) {
permissions.entries.push(newEntry)
}
setSelectedListItem(`${newEntry.identity.id}${newEntry.propagates}`)
openDialog({
name: 'permission-editor',
props: {
entry: newEntry,
path: currentContent!.Path, --> during test run this state is undefined (manually it is okay)
submitCallback: () => {
setRefreshFlag(!refreshFlag)
},
cancelCallback: () => {
permissions?.entries.pop()
},
},
dialogProps: { maxWidth: 'sm', classes: { container: globalClasses.centeredRight } },
})
}
Cypress Version
8.1.0
Other
No response