mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-30 17:28:12 +08:00
Add undo/redo smoke tests for annotations (#1175)
* Add undo/redo tests for annotations Fixes https://github.com/chanzuckerberg/cellxgene/issues/969 ... also refactor the tests for DRY. * Add done() * Make e2e annotations tests safer to concurrency * Add data-testclass for save state. * Simplify tests and make them dependent on save state
This commit is contained in:
@@ -11,7 +11,8 @@ import FilenameDialog from "./filenameDialog";
|
||||
saveInProgress: state.autosave?.saveInProgress ?? false,
|
||||
lastSavedObsAnnotations: state.autosave?.lastSavedObsAnnotations,
|
||||
error: state.autosave?.error,
|
||||
writableCategoriesEnabled: state.config?.parameters?.["annotations"] ?? false
|
||||
writableCategoriesEnabled: state.config?.parameters?.["annotations"] ?? false,
|
||||
initialDataLoadComplete: state.autosave?.initialDataLoadComplete
|
||||
}))
|
||||
class Autosave extends React.Component {
|
||||
constructor(props) {
|
||||
@@ -63,10 +64,17 @@ class Autosave extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { writableCategoriesEnabled } = this.props;
|
||||
const { writableCategoriesEnabled, saveInProgress, initialDataLoadComplete } = this.props;
|
||||
return writableCategoriesEnabled ? (
|
||||
<div
|
||||
id="autosave"
|
||||
data-testclass={
|
||||
!initialDataLoadComplete
|
||||
? "autosave-init"
|
||||
: (this.needToSave() || saveInProgress)
|
||||
? "autosave-incomplete"
|
||||
: "autosave-complete"
|
||||
}
|
||||
style={{
|
||||
position: "fixed",
|
||||
display: "inherit",
|
||||
|
||||
@@ -29,6 +29,7 @@ function InformationMenu(props) {
|
||||
style={{
|
||||
cursor: "pointer"
|
||||
}}
|
||||
data-testid="undo"
|
||||
/>
|
||||
</Tooltip>
|
||||
<Tooltip
|
||||
@@ -46,6 +47,7 @@ function InformationMenu(props) {
|
||||
style={{
|
||||
cursor: "pointer"
|
||||
}}
|
||||
data-testid="redo"
|
||||
/>
|
||||
</Tooltip>
|
||||
<Tooltip
|
||||
|
||||
Reference in New Issue
Block a user