File tree Expand file tree Collapse file tree 2 files changed +26
-19
lines changed Expand file tree Collapse file tree 2 files changed +26
-19
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ public void DropUpload_Footer_Ok()
4848 {
4949 pb . Add ( a => a . ShowFooter , true ) ;
5050 } ) ;
51- cut . Contains ( "<div class=\" upload-drop-footer\" ></div>" ) ;
51+ cut . Contains ( "<div class=\" upload-drop-footer\" ><span class= \" text-muted \" ></span>< /div>" ) ;
5252
5353 cut . SetParametersAndRender ( pb =>
5454 {
@@ -57,6 +57,31 @@ public void DropUpload_Footer_Ok()
5757 cut . Contains ( "<div class=\" upload-drop-footer\" >drop-upload-footer-text</div>" ) ;
5858 }
5959
60+ [ Fact ]
61+ public async Task MaxFileCount_Ok ( )
62+ {
63+ var cut = Context . RenderComponent < DropUpload > ( pb =>
64+ {
65+ pb . Add ( a => a . IsMultiple , true ) ;
66+ pb . Add ( a => a . MaxFileCount , 2 ) ;
67+ } ) ;
68+
69+ var input = cut . FindComponent < InputFile > ( ) ;
70+ await cut . InvokeAsync ( ( ) => input . Instance . OnChange . InvokeAsync ( new InputFileChangeEventArgs ( new List < MockBrowserFile > ( )
71+ {
72+ new ( "test1.png" )
73+ } ) ) ) ;
74+ cut . Contains ( "test1.png" ) ;
75+
76+ await cut . InvokeAsync ( ( ) => input . Instance . OnChange . InvokeAsync ( new InputFileChangeEventArgs ( new List < MockBrowserFile > ( )
77+ {
78+ new ( "test2.png" ) ,
79+ new ( "test3.png" )
80+ } ) ) ) ;
81+ cut . Contains ( "test2.png" ) ;
82+ cut . DoesNotContain ( "test3.png" ) ;
83+ }
84+
6085 [ Fact ]
6186 public async Task DropUpload_OnChanged_Ok ( )
6287 {
Original file line number Diff line number Diff line change @@ -244,24 +244,6 @@ public void InputUpload_IsMultiple()
244244 Assert . False ( button . IsDisabled ( ) ) ;
245245 }
246246
247- [ Fact ]
248- public async Task MaxFileCount_Ok ( )
249- {
250- var cut = Context . RenderComponent < InputUpload < string > > ( pb =>
251- {
252- pb . Add ( a => a . IsMultiple , true ) ;
253- pb . Add ( a => a . MaxFileCount , 2 ) ;
254- } ) ;
255-
256- var input = cut . FindComponent < InputFile > ( ) ;
257- await cut . InvokeAsync ( ( ) => input . Instance . OnChange . InvokeAsync ( new InputFileChangeEventArgs ( new List < MockBrowserFile > ( )
258- {
259- new ( "test1.png" ) , new ( "test2.png" ) , new ( "test3.png" )
260- } ) ) ) ;
261- cut . Contains ( "test1.png;test2.png" ) ;
262- cut . DoesNotContain ( "test3.png" ) ;
263- }
264-
265247 private class Person
266248 {
267249 [ Required ]
You can’t perform that action at this time.
0 commit comments