@@ -13,4 +13,46 @@ describe('ModalService', () => {
1313 it ( 'should be created' , ( ) => {
1414 expect ( service ) . toBeTruthy ( ) ;
1515 } ) ;
16+
17+ describe ( 'open new folder' , ( ) => {
18+ it ( 'should emit an event to open the new folder modal' , ( ) => {
19+ const folderID = '1234' ;
20+ service . openNewFolderModal . subscribe ( ( data ) => {
21+ expect ( data ) . toEqual ( { open : true , folderID } ) ;
22+ } ) ;
23+ service . openNewFolder ( folderID ) ;
24+ } ) ;
25+ } ) ;
26+
27+ describe ( 'open new file' , ( ) => {
28+ it ( 'should emit an event to open the new file modal' , ( ) => {
29+ const folderID = '1234' ;
30+ service . openNewFileModal . subscribe ( ( data ) => {
31+ expect ( data ) . toEqual ( { open : true , folderID } ) ;
32+ } ) ;
33+ service . openNewFile ( folderID ) ;
34+ } ) ;
35+ } ) ;
36+
37+ describe ( 'open update name folder' , ( ) => {
38+ it ( 'should emit an event to open the update name folder modal' , ( ) => {
39+ const folderID = '1234' ;
40+ const name = 'test' ;
41+ service . openUpdateNameModal . subscribe ( ( data ) => {
42+ expect ( data ) . toEqual ( { folderID, name } ) ;
43+ } ) ;
44+ service . openUpdateName ( folderID , name ) ;
45+ } ) ;
46+ } ) ;
47+
48+ describe ( 'open update color folder' , ( ) => {
49+ it ( 'should emit an event to open the update color folder modal' , ( ) => {
50+ const folderID = '1234' ;
51+ const currentColor = 'red' ;
52+ service . openUpdateColorModal . subscribe ( ( data ) => {
53+ expect ( data ) . toEqual ( { folderID, currentColor } ) ;
54+ } ) ;
55+ service . openUpdateColor ( folderID , currentColor ) ;
56+ } ) ;
57+ } ) ;
1658} ) ;
0 commit comments