diff --git a/core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTest.php b/core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTest.php
index eff1fde6f0..f751d5344b 100644
--- a/core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTest.php
+++ b/core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTest.php
@@ -1335,11 +1335,15 @@ public function testWidgetUpload() {
     // assert the field validation does not stop users from removing items.
     $page->fillField('media[0][fields][field_media_test_image][0][alt]', $filenames[0]);
     $page->fillField('media[1][fields][field_media_test_image][0][alt]', $filenames[1]);
+    // Assert the file is available in the file storage.
+    $this->assertCount(1, $file_storage->loadByProperties(['filename' => $filenames[1]]));
     // Remove the second file and assert the focus is shifted to the container
     // of the next media item and field values are still correct.
     $page->pressButton('media-1-remove-button');
     $this->assertJsCondition('jQuery(".media-library-add-form__media[data-media-library-added-delta=2]").is(":focus")');
     $assert_session->pageTextContains('The media item ' . $filenames[1] . ' has been removed.');
+    // Assert the file was deleted.
+    $this->assertEmpty($file_storage->loadByProperties(['filename' => $filenames[1]]));
     // The second media item should be removed (this has the delta 1 since we
     // start counting from 0).
     $assert_session->elementNotExists('css', '.media-library-add-form__media[data-media-library-added-delta=1]');
