@@ -64,6 +64,62 @@ const moduleConfig = {
6464 }
6565} ;
6666
67+ const moduleConfig_T1301121 = {
68+ beforeEach : function ( ) {
69+ const markup = '<div style="display: flex; flex-flow: column nowrap;"><div id="file-manager-1"></div><div id="file-manager-2"></div></div>' ;
70+ $ ( '#qunit-fixture' ) . html ( markup ) ;
71+
72+ this . clock = sinon . useFakeTimers ( ) ;
73+ fx . off = true ;
74+
75+ const createProvider = fileManagerName => new CustomFileSystemProvider ( {
76+ getItems : parent => {
77+ if ( fileManagerName === 'fileManager2' ) {
78+ return Promise . reject ( new FileSystemError ( 42 , parent , 'You have no access to this folder.' ) ) ;
79+ }
80+ return [
81+ {
82+ name : 'Folder 1' ,
83+ isDirectory : true ,
84+ hasSubDirectories : false
85+ }
86+ ] ;
87+ } ,
88+ } ) ;
89+
90+ const getFmOptions = rootFolderName => ( {
91+ name : rootFolderName ,
92+ rootFolderName : rootFolderName ,
93+ fileSystemProvider : createProvider ( rootFolderName ) ,
94+ notifications : {
95+ showPanel : true ,
96+ showPopup : true
97+ }
98+ } ) ;
99+
100+ this . $fMElement1 = $ ( '#file-manager-1' ) . dxFileManager ( getFmOptions ( 'fileManager1' ) ) ;
101+ this . $fMElement2 = $ ( '#file-manager-2' ) . dxFileManager ( getFmOptions ( 'fileManager2' ) ) ;
102+
103+ this . fileManager1 = this . $fMElement1 . dxFileManager ( 'instance' ) ;
104+ this . fileManager2 = this . $fMElement2 . dxFileManager ( 'instance' ) ;
105+
106+ this . wrapper1 = new FileManagerWrapper ( this . $fMElement1 ) ;
107+ this . wrapper2 = new FileManagerWrapper ( this . $fMElement2 ) ;
108+ this . progressPanelWrapper1 = new FileManagerProgressPanelWrapper ( this . $fMElement1 ) ;
109+ this . progressPanelWrapper2 = new FileManagerProgressPanelWrapper ( this . $fMElement2 ) ;
110+ this . clock . tick ( 400 ) ;
111+ } ,
112+
113+ afterEach : function ( ) {
114+ this . clock . tick ( 5000 ) ;
115+
116+ this . clock . restore ( ) ;
117+ fx . off = false ;
118+
119+ FileUploaderInternals . resetFileInputTag ( ) ;
120+ }
121+ } ;
122+
67123QUnit . module ( 'Editing operations' , moduleConfig , ( ) => {
68124
69125 test ( 'rename folder in folders area' , function ( assert ) {
@@ -2457,3 +2513,26 @@ QUnit.module('Editing operations', moduleConfig, () => {
24572513 fx . off = true ;
24582514 } ) ;
24592515} ) ;
2516+
2517+ QUnit . module ( 'double FileManager - notification displayed next to correct FileManager (Bugs)' , moduleConfig_T1301121 , ( ) => {
2518+
2519+ test ( 'error in second filemanager displayed in the popup located next to second filemanager' , function ( assert ) {
2520+ this . clock . tick ( 800 ) ;
2521+
2522+ const $popupContents = this . wrapper2 . getNotificationPopup ( ) ;
2523+ const popupInstance = this . wrapper2 . getNotificationPopupInstance ( ) ;
2524+
2525+ assert . strictEqual ( this . progressPanelWrapper1 . getInfos ( ) . length , 0 , 'There is no notifications on panel of first filemanager' ) ;
2526+ assert . strictEqual ( this . progressPanelWrapper2 . getInfos ( ) . length , 1 , 'There is one notification on panel of second filemanager' ) ;
2527+
2528+ assert . ok ( $popupContents . is ( ':visible' ) , 'notification popup is visible' ) ;
2529+ const popupTop = $popupContents [ 0 ] . getBoundingClientRect ( ) . top ;
2530+ const popupLeft = $popupContents [ 0 ] . getBoundingClientRect ( ) . left ;
2531+ const fileManager2Top = this . $fMElement2 [ 0 ] . getBoundingClientRect ( ) . top ;
2532+ const fileManager2Left = this . $fMElement2 [ 0 ] . getBoundingClientRect ( ) . left ;
2533+ assert . true ( popupTop > fileManager2Top , `notification popup is visible below second filemanager upper border (${ popupTop } > ${ fileManager2Top } )` ) ;
2534+ assert . true ( popupLeft > fileManager2Left , `notification popup is visible to the right of second filemanager (${ popupLeft } > ${ fileManager2Left } )` ) ;
2535+ assert . true ( this . wrapper2 . getContainer ( ) [ 0 ] . isEqualNode ( popupInstance . option ( 'position' ) . of [ 0 ] ) , 'notification popup position is correct' ) ;
2536+ } ) ;
2537+
2538+ } ) ;
0 commit comments