mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-22 16:09:14 +08:00
c629967c3d
commit423cf4f407
Author: Ben Gotow <ben@foundry376.com> Date: Fri Oct 11 22:33:53 2019 -0500 Replace belcard with homegrown VCard parser because our needs are minimal and the linux binary has relocation issues commit4ae19c0ed5
Author: Ben Gotow <ben@foundry376.com> Date: Fri Oct 11 10:38:26 2019 -0500 Skip building a few more belr components, still looking for relocation error cause commita7ec02a449
Author: Ben Gotow <ben@foundry376.com> Date: Thu Oct 10 22:16:15 2019 -0500 Fix windows SRV record lookups for contact directory autodiscovery commit318a31d279
Author: Ben Gotow <ben@foundry376.com> Date: Thu Oct 10 20:50:06 2019 -0500 Leave vcard_grammar unpacked so mailsync can find it at runtime commitbf7e43e37d
Author: Ben Gotow <ben@foundry376.com> Date: Thu Oct 10 20:43:01 2019 -0500 Fix bug in icon case sensitivity commitc283513653
Author: Ben Gotow <ben@foundry376.com> Date: Thu Oct 10 17:29:24 2019 -0500 Renew Windows Authenticode code signing cert (there goes $500…) commitd13235f65b
Author: Ben Gotow <ben@foundry376.com> Date: Wed Oct 9 23:25:34 2019 -0500 Bump mailsync to move belr dlls commit00ca6431df
Author: Ben Gotow <ben@foundry376.com> Date: Wed Oct 9 23:22:53 2019 -0500 Bump to xcode9 to fix odd C++11 error commit47903c99c4
Author: Ben Gotow <ben@foundry376.com> Date: Wed Oct 9 23:01:32 2019 -0500 Bump mailsync to build belr as a dll instead of a static lib commit21d645d4e7
Author: Ben Gotow <ben@foundry376.com> Date: Wed Oct 9 22:38:24 2019 -0500 Bump mailsync commit3f943031cb
Author: Ben Gotow <ben@foundry376.com> Date: Wed Oct 9 21:57:39 2019 -0500 Bump mailsync to fix windows libetpan failure commit8fb55ca0fc
Author: Ben Gotow <ben@foundry376.com> Date: Wed Oct 9 21:36:57 2019 -0500 Bump mailsync, add grammar commitb959c54e50
Author: Ben Gotow <ben@foundry376.com> Date: Wed Oct 9 21:20:13 2019 -0500 Bump mailsync for linux / win32 commitddb5229d67
Author: Ben Gotow <ben@foundry376.com> Date: Tue Oct 8 22:44:12 2019 -0500 Bump mailsync commitf80e1bc422
Author: Ben Gotow <ben@foundry376.com> Date: Tue Oct 8 11:11:39 2019 -0500 Fix LESS linter failures commit66dc60a731
Author: Ben Gotow <ben@foundry376.com> Date: Tue Oct 8 11:00:37 2019 -0500 Extend participant search to return / expand groups commit3bded91307
Author: Ben Gotow <ben@foundry376.com> Date: Tue Oct 8 03:18:11 2019 -0500 Add comments, etc commit4ede5446de
Author: Ben Gotow <ben@foundry376.com> Date: Tue Oct 8 02:38:50 2019 -0500 Google People API contacts CRUD alongside CardDav commit96c6a64e46
Author: Ben Gotow <ben@foundry376.com> Date: Mon Oct 7 14:00:34 2019 -0500 Build ContactBook concept to track which accounts have sync running commit1f6aab1083
Author: Ben Gotow <ben@foundry376.com> Date: Mon Oct 7 11:38:03 2019 -0500 Contact and contact group CRUD, address book menus commitb877c58d48
Author: Ben Gotow <ben@foundry376.com> Date: Sun Oct 6 16:32:33 2019 -0500 Editing contact names working commit761079304c
Author: Ben Gotow <ben@foundry376.com> Date: Mon Sep 30 15:42:59 2019 -0500 Improved styling of YYYYMMDD field commit71a567276b
Author: Ben Gotow <ben@foundry376.com> Date: Mon Sep 30 15:06:28 2019 -0500 UI for edit + move + delete contacts commitf1967dd603
Author: Ben Gotow <ben@foundry376.com> Date: Thu Sep 26 13:50:44 2019 -0500 Allow you to turn on / off the “Found in Mail” autocompletions commit0c2b0eb03b
Author: Ben Gotow <ben@foundry376.com> Date: Thu Sep 26 13:50:14 2019 -0500 Improve contacts window launch perf by lazy loading composer support, scanning less of fs for themes commit07abd6cb71
Author: Ben Gotow <ben@foundry376.com> Date: Thu Sep 26 04:36:10 2019 -0500 Support for CardDav contact display, better groups presentation commit0a9e166d79
Author: Ben Gotow <ben@foundry376.com> Date: Tue Sep 24 12:42:37 2019 -0500 Add hidden attribute to the model in prep for deletion of auto-created contacts commite6ce3b2af9
Author: Ben Gotow <ben@foundry376.com> Date: Tue Sep 24 12:12:52 2019 -0500 Initial pass at address book commit740d7e8655
Author: Ben Gotow <ben@foundry376.com> Date: Tue Sep 24 08:27:06 2019 -0500 Make headers of Preferences > Accounts consistent with General
78 lines
3.9 KiB
TypeScript
78 lines
3.9 KiB
TypeScript
import { Thread } from '../../src/flux/models/thread';
|
|
import { Folder } from '../../src/flux/models/folder';
|
|
import _ from 'underscore';
|
|
|
|
describe('Thread', function() {
|
|
describe('serialization performance', () =>
|
|
xit('1,000,000 iterations', function() {
|
|
let iterations = 0;
|
|
const json =
|
|
'[{"client_id":"local-76c370af-65de","server_id":"f0vkowp7zxt7djue7ifylb940","__cls":"Thread","account_id":"1r6w6qiq3sb0o9fiwin6v87dd","snippet":"http://itunestandc.tumblr.com/tagged/itunes-terms-and-conditions/chrono _______________________________________________ http://www.macgroup.com/mailman/listinfo/smartfriends-chat","subject":"iTunes Terms And Conditions as you\'ve never seen them before","unread":true,"starred":false,"version":1,"folders":[],"labels":[{"server_id":"8cf4fn20k9pjjhjawrv3xrxo0","name":"all","display_name":"All Mail","id":"8cf4fn20k9pjjhjawrv3xrxo0"},{"server_id":"f1lq8faw8vv06m67y8f3xdf84","name":"inbox","display_name":"Inbox","id":"f1lq8faw8vv06m67y8f3xdf84"}],"participants":[{"name":"Andrew Stadler","email":"stadler@gmail.com"},{"name":"Smart Friends™ Chat","email":"smartfriends-chat@macgroup.com"}],"attachmentCount":0,"lastMessageReceivedTimestamp":1446600615,"id":"f0vkowp7zxt7djue7ifylb940"}]';
|
|
const start = Date.now();
|
|
while (iterations < 1000000) {
|
|
var data;
|
|
if (_.isString(json)) {
|
|
data = JSON.parse(json);
|
|
}
|
|
const object = new Thread();
|
|
object.fromJSON(data);
|
|
iterations += 1;
|
|
}
|
|
console.log((Date.now() - start) / 1000.0 + 'ms per 1000');
|
|
}));
|
|
|
|
describe('sortedCategories', function() {
|
|
const sortedForCategoryNames = function(inputs) {
|
|
const categories = inputs.map(i => new Folder({ path: i, role: i }));
|
|
const thread = new Thread({ labels: categories, folders: [] });
|
|
return thread.sortedCategories();
|
|
};
|
|
|
|
it("puts 'important' label first, if it's present", function() {
|
|
const inputs = ['alphabetically before important', 'important'];
|
|
const actualOut = sortedForCategoryNames(inputs);
|
|
expect(actualOut[0].displayName).toBe('important');
|
|
});
|
|
|
|
it("ignores 'important' label if not present", function() {
|
|
const inputs = ['not important'];
|
|
const actualOut = sortedForCategoryNames(inputs);
|
|
expect(actualOut.length).toBe(1);
|
|
expect(actualOut[0].displayName).toBe('not important');
|
|
});
|
|
|
|
it("doesn't display 'all', 'archive', or 'drafts'", function() {
|
|
const inputs = ['all', 'archive', 'drafts'];
|
|
const actualOut = sortedForCategoryNames(inputs);
|
|
expect(actualOut.length).toBe(0);
|
|
});
|
|
|
|
it("displays standard category names which aren't hidden next, if they're present", function() {
|
|
const inputs = ['inbox', 'important', 'social'];
|
|
const actualOut = _.pluck(sortedForCategoryNames(inputs), 'displayName');
|
|
const expectedOut = ['important', 'inbox', 'social'];
|
|
expect(actualOut).toEqual(expectedOut);
|
|
});
|
|
|
|
it("ignores standard category names if they aren't present", function() {
|
|
const inputs = ['social', 'work', 'important'];
|
|
const actualOut = _.pluck(sortedForCategoryNames(inputs), 'displayName');
|
|
const expectedOut = ['important', 'social', 'work'];
|
|
expect(actualOut).toEqual(expectedOut);
|
|
});
|
|
|
|
it('puts user-added categories at the end', function() {
|
|
const inputs = ['food', 'inbox'];
|
|
const actualOut = _.pluck(sortedForCategoryNames(inputs), 'displayName');
|
|
const expectedOut = ['inbox', 'food'];
|
|
expect(actualOut).toEqual(expectedOut);
|
|
});
|
|
|
|
it('sorts user-added categories by displayName', function() {
|
|
const inputs = ['work', 'social', 'receipts', 'important', 'inbox'];
|
|
const actualOut = _.pluck(sortedForCategoryNames(inputs), 'displayName');
|
|
const expectedOut = ['important', 'inbox', 'receipts', 'social', 'work'];
|
|
expect(actualOut).toEqual(expectedOut);
|
|
});
|
|
});
|
|
});
|