1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-28 15:22:05 +03:00

Conform more code to strict null checking (#10169)

* Conform more code to strict null checking

* delint

* Iterate

* delint

* Fix bad test
This commit is contained in:
Michael Telatynski
2023-02-16 09:38:44 +00:00
committed by GitHub
parent 5123d7e641
commit e8b92b308b
85 changed files with 283 additions and 287 deletions

View File

@ -125,7 +125,7 @@ describe("VoiceMessageRecording", () => {
const encryptedFile = {} as unknown as IEncryptedFile;
beforeEach(() => {
voiceRecording.onDataAvailable(testBuf);
voiceRecording.onDataAvailable!(testBuf);
});
it("contentLength should return the buffer length", () => {
@ -143,9 +143,9 @@ describe("VoiceMessageRecording", () => {
});
describe("upload", () => {
let uploadFileClient: MatrixClient;
let uploadFileRoomId: string;
let uploadBlob: Blob;
let uploadFileClient: MatrixClient | null;
let uploadFileRoomId: string | null;
let uploadBlob: Blob | null;
beforeEach(() => {
uploadFileClient = null;
@ -182,8 +182,8 @@ describe("VoiceMessageRecording", () => {
expect(mocked(uploadFile)).toHaveBeenCalled();
expect(uploadFileClient).toBe(client);
expect(uploadFileRoomId).toBe(roomId);
expect(uploadBlob.type).toBe(contentType);
const blobArray = await uploadBlob.arrayBuffer();
expect(uploadBlob?.type).toBe(contentType);
const blobArray = await uploadBlob!.arrayBuffer();
expect(new Uint8Array(blobArray)).toEqual(testBuf);
});