Skip to content

Commit 0aa8ec6

Browse files
Pavitra KhatriPavitra Khatri
authored andcommitted
Fix size issue on uploading the file again
1 parent 62fbdf9 commit 0aa8ec6

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

ui.frontend/src/view/FormFileInputWidgetBase.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ class FormFileInputWidgetBase {
481481

482482
// if the file is not invalid, show it and push it to internal array
483483
if (!isCurrentInvalidFileSize && !isCurrentInvalidFileName && !isCurrentInvalidMimeType) {
484-
this.showFileList(currFileName);
484+
this.showFileList(currFileName, file.size);
485485
if(this.isMultiSelect()) {
486486
this.values.push(currFileName);
487487
this.fileArr.push(file);

ui.tests/test-module/specs/fileinput/fileinputv3.runtime.cy.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,4 +248,13 @@ describe('Click on button tag (V-3)', () => {
248248
expect(alertText).to.equal(model.getState().constraintMessages.maxFileSize);
249249
});
250250
});
251+
252+
it('file when uploaded again should give actual size', () => {
253+
let sampleFileNames = ['sample.svg'];
254+
const fileInput = "input[name='fileinput1']";
255+
cy.attachFile(fileInput, [sampleFileNames[0]]);
256+
cy.get('.cmp-adaptiveform-fileinput__filesize').should('contain.text', '508 bytes');
257+
cy.attachFile(fileInput, [sampleFileNames[0]]);
258+
cy.get('.cmp-adaptiveform-fileinput__filesize').should('contain.text', '508 bytes');
259+
})
251260
})

0 commit comments

Comments
 (0)