Avatar defaults and colors
This commit is contained in:
parent
a001882d58
commit
12d2b1bf7c
140 changed files with 4212 additions and 1084 deletions
|
@ -8,17 +8,25 @@ import { getDefaultConversation } from '../../../test-both/helpers/getDefaultCon
|
|||
|
||||
import { LeftPaneSetGroupMetadataHelper } from '../../../components/leftPane/LeftPaneSetGroupMetadataHelper';
|
||||
|
||||
function getComposeState() {
|
||||
return {
|
||||
groupAvatar: undefined,
|
||||
groupExpireTimer: 0,
|
||||
groupName: '',
|
||||
hasError: false,
|
||||
isCreating: false,
|
||||
isEditingAvatar: false,
|
||||
selectedContacts: [],
|
||||
userAvatarData: [],
|
||||
};
|
||||
}
|
||||
|
||||
describe('LeftPaneSetGroupMetadataHelper', () => {
|
||||
describe('getBackAction', () => {
|
||||
it('returns the "show composer" action if a request is not active', () => {
|
||||
const showChooseGroupMembers = sinon.fake();
|
||||
const helper = new LeftPaneSetGroupMetadataHelper({
|
||||
groupAvatar: undefined,
|
||||
groupExpireTimer: 0,
|
||||
groupName: '',
|
||||
hasError: false,
|
||||
isCreating: false,
|
||||
selectedContacts: [],
|
||||
...getComposeState(),
|
||||
});
|
||||
|
||||
assert.strictEqual(
|
||||
|
@ -29,12 +37,9 @@ describe('LeftPaneSetGroupMetadataHelper', () => {
|
|||
|
||||
it("returns undefined (i.e., you can't go back) if a request is active", () => {
|
||||
const helper = new LeftPaneSetGroupMetadataHelper({
|
||||
groupAvatar: undefined,
|
||||
groupExpireTimer: 0,
|
||||
...getComposeState(),
|
||||
groupName: 'Foo Bar',
|
||||
hasError: false,
|
||||
isCreating: true,
|
||||
selectedContacts: [],
|
||||
});
|
||||
|
||||
assert.isUndefined(
|
||||
|
@ -47,12 +52,7 @@ describe('LeftPaneSetGroupMetadataHelper', () => {
|
|||
it('returns 0 if there are no contacts', () => {
|
||||
assert.strictEqual(
|
||||
new LeftPaneSetGroupMetadataHelper({
|
||||
groupAvatar: undefined,
|
||||
groupExpireTimer: 0,
|
||||
groupName: '',
|
||||
hasError: false,
|
||||
isCreating: false,
|
||||
selectedContacts: [],
|
||||
...getComposeState(),
|
||||
}).getRowCount(),
|
||||
0
|
||||
);
|
||||
|
@ -61,11 +61,7 @@ describe('LeftPaneSetGroupMetadataHelper', () => {
|
|||
it('returns the number of candidate contacts + 2 if there are any', () => {
|
||||
assert.strictEqual(
|
||||
new LeftPaneSetGroupMetadataHelper({
|
||||
groupAvatar: undefined,
|
||||
groupExpireTimer: 0,
|
||||
groupName: '',
|
||||
hasError: false,
|
||||
isCreating: false,
|
||||
...getComposeState(),
|
||||
selectedContacts: [
|
||||
getDefaultConversation(),
|
||||
getDefaultConversation(),
|
||||
|
@ -80,12 +76,7 @@ describe('LeftPaneSetGroupMetadataHelper', () => {
|
|||
it('returns undefined if there are no contacts', () => {
|
||||
assert.isUndefined(
|
||||
new LeftPaneSetGroupMetadataHelper({
|
||||
groupAvatar: undefined,
|
||||
groupExpireTimer: 0,
|
||||
groupName: '',
|
||||
hasError: false,
|
||||
isCreating: false,
|
||||
selectedContacts: [],
|
||||
...getComposeState(),
|
||||
}).getRow(0)
|
||||
);
|
||||
});
|
||||
|
@ -96,11 +87,7 @@ describe('LeftPaneSetGroupMetadataHelper', () => {
|
|||
getDefaultConversation(),
|
||||
];
|
||||
const helper = new LeftPaneSetGroupMetadataHelper({
|
||||
groupAvatar: undefined,
|
||||
groupExpireTimer: 0,
|
||||
groupName: '',
|
||||
hasError: false,
|
||||
isCreating: false,
|
||||
...getComposeState(),
|
||||
selectedContacts,
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue