@@ -44,6 +44,7 @@ describe('Dataset manager can be empty on start', () => {
4444describe ( 'Data edition in dataset manager' , ( ) => {
4545 before ( ( ) => {
4646 stub . start ( ) ;
47+ stub . setOrganizations ( [ ORGANIZATION_WITH_DEFAULT_ROLE_USER ] ) ;
4748 stub . setWorkspaces ( WORKSPACES ) ;
4849 stub . setSolutions ( [ SOLUTION_WITH_TRANSLATED_RUN_TEMPLATES ] ) ;
4950 // we use the copy of DATASETS array to be able to reuse the same fixture
@@ -116,6 +117,48 @@ describe('Data edition in dataset manager', () => {
116117 DatasetManager . getDatasetMetadataDescription ( ) . should ( 'contain' , newDescription ) ;
117118 DatasetManager . getDatasetMetadataTag ( 1 ) . should ( 'contain' , newTag ) ;
118119 } ) ;
120+
121+ it ( 'correctly handles the form state even after closing and reopening the dataset creation dialog' , ( ) => {
122+ DatasetManager . ignoreDatasetTwingraphQueries ( ) ;
123+ DatasetManager . switchToDatasetManagerView ( ) ;
124+
125+ const stepsToCheckTwice = ( ) => {
126+ DatasetManager . startDatasetCreation ( ) ;
127+ DatasetManager . setNewDatasetName ( 'canceledDataset' ) ;
128+ DatasetManager . getDatasetCreationNextStep ( ) . click ( ) ;
129+ DatasetManager . selectNewDatasetSourceType ( 'partially_prefilled_datasource' ) ;
130+ DatasetManager . getConfirmDatasetCreation ( ) . should ( 'be.disabled' ) ;
131+ cy . get ( '[data-cy=text-input-etl_string_parameter]' ) . type ( '{selectAll}{backspace}' + 'foo' ) ;
132+ DatasetManager . getConfirmDatasetCreation ( ) . should ( 'not.be.disabled' ) ;
133+
134+ DatasetManager . getNewDatasetSourceTypeSelect ( ) . click ( ) ;
135+ DatasetManager . getNewDatasetSourceTypeOptionFile ( ) . click ( ) ;
136+ DatasetManager . getConfirmDatasetCreation ( ) . should ( 'be.disabled' ) ;
137+
138+ DatasetManager . selectNewDatasetSourceType ( 'partially_prefilled_datasource' ) ;
139+ DatasetManager . getConfirmDatasetCreation ( ) . should ( 'not.be.disabled' ) ;
140+
141+ DatasetManager . getCancelDatasetCreation ( ) . click ( ) ;
142+ DatasetManager . getDatasetCreationDialog ( ) . should ( 'not.exist' ) ;
143+ } ;
144+
145+ stepsToCheckTwice ( ) ;
146+ stepsToCheckTwice ( ) ;
147+ } ) ;
148+
149+ it ( 'correctly handles the form state even after closing and reopening the sub-dataset creation dialog' , ( ) => {
150+ DatasetManager . ignoreDatasetTwingraphQueries ( ) ;
151+ DatasetManager . switchToDatasetManagerView ( ) ;
152+
153+ const stepsToCheckTwice = ( ) => {
154+ DatasetManager . startSubdatasetCreation ( ) ;
155+ DatasetManager . getDatasetCreationNextStep ( ) . should ( 'not.be.disabled' ) ;
156+ DatasetManager . getCancelDatasetCreation ( ) . click ( ) ;
157+ } ;
158+
159+ stepsToCheckTwice ( ) ;
160+ stepsToCheckTwice ( ) ;
161+ } ) ;
119162} ) ;
120163
121164describe ( 'Dataset creation' , ( ) => {
@@ -296,7 +339,7 @@ describe('Refresh dataset', () => {
296339 after ( stub . stop ) ;
297340
298341 it (
299- 'can refresh ADT and AzureStorage datasets and display en empty dataset placeholder ' +
342+ 'can refresh ADT and AzureStorage datasets and display an empty dataset placeholder ' +
300343 'for the one created from scratch' ,
301344 ( ) => {
302345 const refreshSuccessOptions = {
0 commit comments