mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-18 23:49:20 +01:00
Rename files
This commit is contained in:
56
ts/test-node/util/isConversationNameKnown_test.std.ts
Normal file
56
ts/test-node/util/isConversationNameKnown_test.std.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { isConversationNameKnown } from '../../util/isConversationNameKnown.std.js';
|
||||
|
||||
describe('isConversationNameKnown', () => {
|
||||
describe('for direct conversations', () => {
|
||||
it('returns true if the conversation has a name', () => {
|
||||
assert.isTrue(
|
||||
isConversationNameKnown({
|
||||
type: 'direct',
|
||||
name: 'Jane Doe',
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('returns true if the conversation has a profile name', () => {
|
||||
assert.isTrue(
|
||||
isConversationNameKnown({
|
||||
type: 'direct',
|
||||
profileName: 'Jane Doe',
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('returns true if the conversation has an E164', () => {
|
||||
assert.isTrue(
|
||||
isConversationNameKnown({
|
||||
type: 'direct',
|
||||
e164: '+16505551234',
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('returns false if the conversation has none of the above', () => {
|
||||
assert.isFalse(isConversationNameKnown({ type: 'direct' }));
|
||||
});
|
||||
});
|
||||
|
||||
describe('for group conversations', () => {
|
||||
it('returns true if the conversation has a name', () => {
|
||||
assert.isTrue(
|
||||
isConversationNameKnown({
|
||||
type: 'group',
|
||||
name: 'Tahoe Trip',
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('returns true if the conversation lacks a name', () => {
|
||||
assert.isFalse(isConversationNameKnown({ type: 'group' }));
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user