Update tests to ensure file size unit has been fixed (#10568)

* Update tests to ensure file size unit has been fixed

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Update cypress/e2e/timeline/timeline.spec.ts

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

* Edit comments mentioning kilobytes

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

---------

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
This commit is contained in:
Suguru Hirahara 2023-04-12 10:21:13 +00:00 committed by GitHub
parent 3c4fa8b430
commit bef6eca484
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 45 additions and 0 deletions

View file

@ -211,6 +211,23 @@ describe("FilePanel", () => {
});
});
it("should render file size in kibibytes on a file tile", () => {
const size = "1.12 KB"; // actual file size in kibibytes (1024 bytes)
// Upload a file
uploadFile("cypress/fixtures/matrix-org-client-versions.json");
cy.get(".mx_FilePanel .mx_EventTile").within(() => {
// Assert that the file size is displayed in kibibytes, not kilobytes (1000 bytes)
// See: https://github.com/vector-im/element-web/issues/24866
cy.contains(".mx_MFileBody_info_filename", size).should("exist");
cy.get(".mx_MFileBody_download").within(() => {
cy.contains("a", size).should("exist");
cy.contains(".mx_MImageBody_size", size).should("exist");
});
});
});
it("should not add inline padding to a tile when it is selected with right click", () => {
// Upload a file
uploadFile("cypress/fixtures/1sec.ogg");