@@ -155,7 +155,7 @@ describe('Department Management Tests', () => {
155155 cy . url ( ) . should ( 'include' , ROUTES . newDepartment . path ) ;
156156 } ) ;
157157
158- it ( 'should be able to create a new department and be navigated back to department catalog page if the form is valid and the department creation succeeded' , ( ) => {
158+ it ( 'should be able to create a new department and be navigated back to the Department Catalog page if the form is valid and the department creation succeeded' , ( ) => {
159159 interceptFetchDepartmentsRequest ( ) ;
160160 interceptFetchEmployeesByIdsRequest ( { ids : [ 333333333335 , 333333333334 , 333333333333 ] } ) ;
161161 interceptFetchEmployeesByIdsRequest ( { ids : [ 333333333335 , 333333333334 ] } ) ;
@@ -198,9 +198,20 @@ describe('Department Management Tests', () => {
198198 'have.text' ,
199199 'Set Design'
200200 ) ;
201+
202+ getTestSelectorByModule ( Module . departmentManagement , SubModule . departmentCatalog , 'table-layout-action-button' ) . click ( ) ;
203+ getTestSelectorByModule ( Module . departmentManagement , SubModule . departmentDetails , 'form-field-parentDepartmentId' ) . click ( ) ;
204+
205+ getTestSelectorByModule ( Module . departmentManagement , SubModule . departmentDetails , 'form-field-parentDepartmentId-option' , true ) . should (
206+ 'have.length' ,
207+ 5
208+ ) ;
209+ getTestSelectorByModule ( Module . departmentManagement , SubModule . departmentDetails , 'form-field-parentDepartmentId-option-444444444448' )
210+ . should ( 'exist' )
211+ . and ( 'have.text' , 'Set Design' ) ;
201212 } ) ;
202213
203- it ( 'should display not found page if the department was not found' , ( ) => {
214+ it ( 'should display Not Found page if the department was not found' , ( ) => {
204215 interceptFetchDepartmentsRequest ( ) ;
205216 interceptFetchEmployeesByIdsRequest ( { ids : [ 333333333335 , 333333333334 , 333333333333 ] } ) ;
206217 interceptFetchDepartmentsByIdsRequest ( { ids : [ 444444444444 ] } ) ;
@@ -214,7 +225,7 @@ describe('Department Management Tests', () => {
214225 cy . location ( 'pathname' ) . should ( 'eq' , ROUTES . flows . path ) ;
215226 } ) ;
216227
217- it ( 'should reset the form and be navigated back to the department catalog page if the cancel button is clicked' , ( ) => {
228+ it ( 'should reset the form and be navigated back to the Department Catalog page if the cancel button is clicked' , ( ) => {
218229 interceptFetchDepartmentsRequest ( ) ;
219230 interceptFetchEmployeesByIdsRequest ( { ids : [ 333333333335 , 333333333334 , 333333333333 ] } ) ;
220231 interceptFetchDepartmentsByIdsRequest ( { ids : [ 444444444444 ] } ) ;
@@ -359,7 +370,7 @@ describe('Department Management Tests', () => {
359370 . and ( 'contain.text' , 'Failed to create a Department' ) ;
360371 } ) ;
361372
362- it ( 'should be able to edit the department and be navigated back to the department catalog page if the form is valid and department updating succeeded' , ( ) => {
373+ it ( 'should be able to edit the department and be navigated back to the Department Catalog page if the form is valid and department updating succeeded' , ( ) => {
363374 interceptFetchDepartmentsRequest ( ) ;
364375 interceptFetchEmployeesByIdsRequest ( { ids : [ 333333333335 , 333333333334 , 333333333333 ] } ) ;
365376 interceptFetchDepartmentsByIdsRequest ( { ids : [ 444444444444 ] } ) ;
@@ -429,6 +440,17 @@ describe('Department Management Tests', () => {
429440 getTestSelectorByModule ( Module . shared , SubModule . snackbar , 'success' )
430441 . should ( 'exist' )
431442 . and ( 'contain.text' , 'Department has been successfully updated' ) ;
443+
444+ getTestSelectorByModule ( Module . departmentManagement , SubModule . departmentCatalog , 'table-layout-action-button' ) . click ( ) ;
445+ getTestSelectorByModule ( Module . departmentManagement , SubModule . departmentDetails , 'form-field-parentDepartmentId' ) . click ( ) ;
446+
447+ getTestSelectorByModule ( Module . departmentManagement , SubModule . departmentDetails , 'form-field-parentDepartmentId-option' , true ) . should (
448+ 'have.length' ,
449+ 4
450+ ) ;
451+ getTestSelectorByModule ( Module . departmentManagement , SubModule . departmentDetails , 'form-field-parentDepartmentId-option-444444444447' )
452+ . should ( 'exist' )
453+ . and ( 'have.text' , 'Costume Updated' ) ;
432454 } ) ;
433455
434456 it ( 'should be able to navigate back when the back button is clicked' , ( ) => {
0 commit comments