@@ -1369,35 +1369,6 @@ public void CanBindToFormWithFiles()
13691369 Assert . Equal ( "Total: 7" , Browser . Exists ( By . Id ( "form-collection" ) ) . Text ) ;
13701370 }
13711371
1372- [ Fact ]
1373- public void IBrowserFileNameReturnsFileNameNotFormFieldName ( )
1374- {
1375- // Create a file with a specific name to verify it's returned correctly
1376- var testFile = TempFile . Create ( _tempDirectory , "txt" , "Test file content for name validation." ) ;
1377-
1378- var dispatchToForm = new DispatchToForm ( this )
1379- {
1380- Url = "forms/with-files" ,
1381- FormCssSelector = "form" ,
1382- FormIsEnhanced = false ,
1383- UpdateFormAction = ( ) =>
1384- {
1385- // Upload file to HeaderPhoto field (which is an IBrowserFile)
1386- // Form field name is "Model.HeaderPhoto" but file name should be testFile.Name
1387- Browser . Exists ( By . CssSelector ( "input[name='Model.HeaderPhoto']" ) ) . SendKeys ( testFile . Path ) ;
1388- }
1389- } ;
1390- DispatchToFormCore ( dispatchToForm ) ;
1391-
1392- // Verify that IBrowserFile.Name returns the actual file name, not the form field name
1393- // Before the fix: would show "Header Photo: Model.HeaderPhoto" (form field name)
1394- // After the fix: should show "Header Photo: {testFile.Name}" (actual file name)
1395- Assert . Equal ( $ "Header Photo: { testFile . Name } ", Browser . Exists ( By . Id ( "header-photo" ) ) . Text ) ;
1396-
1397- // Ensure the file name is actually different from the form field name to validate the test
1398- Assert . NotEqual ( "Model.HeaderPhoto" , testFile . Name ) ;
1399- }
1400-
14011372 [ Theory ]
14021373 // [InlineData(true)] QuarantinedTest: https://github.com/dotnet/aspnetcore/issues/61882
14031374 [ InlineData ( false ) ]
0 commit comments