Receive support for Sender Key
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
This commit is contained in:
parent
e5f9c0db28
commit
e6bab06510
28 changed files with 743 additions and 164 deletions
31
ts/test-electron/util/isByteBufferEmpty_test.ts
Normal file
31
ts/test-electron/util/isByteBufferEmpty_test.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { isByteBufferEmpty } from '../../util/isByteBufferEmpty';
|
||||
|
||||
describe('isByteBufferEmpty', () => {
|
||||
it('returns true for undefined', () => {
|
||||
assert.isTrue(isByteBufferEmpty(undefined));
|
||||
});
|
||||
|
||||
it('returns true for object missing limit', () => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const brokenByteBuffer: any = {};
|
||||
|
||||
assert.isTrue(isByteBufferEmpty(brokenByteBuffer));
|
||||
});
|
||||
|
||||
it('returns true for object limit', () => {
|
||||
const emptyByteBuffer = new window.dcodeIO.ByteBuffer(0);
|
||||
|
||||
assert.isTrue(isByteBufferEmpty(emptyByteBuffer));
|
||||
});
|
||||
|
||||
it('returns false for object limit', () => {
|
||||
const byteBuffer = window.dcodeIO.ByteBuffer.wrap('AABBCC', 'hex');
|
||||
|
||||
assert.isFalse(isByteBufferEmpty(byteBuffer));
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue