mirror of
https://github.com/zulip/zulip.git
synced 2025-11-18 12:54:58 +00:00
This commit was originally automatically generated using `tools/lint --only=eslint --fix`. It was then modified by tabbott to contain only changes to a set of files that are unlikely to result in significant merge conflicts with any open pull request, excluding about 20 files. His plan is to merge the remaining changes with more precise care, potentially involving merging parts of conflicting pull requests before running the `eslint --fix` operation. Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
31 lines
804 B
JavaScript
31 lines
804 B
JavaScript
const pmc = zrequire('pm_conversations');
|
|
|
|
run_test('partners', () => {
|
|
const user1_id = 1;
|
|
const user2_id = 2;
|
|
const user3_id = 3;
|
|
|
|
pmc.set_partner(user1_id);
|
|
pmc.set_partner(user3_id);
|
|
|
|
assert.equal(pmc.is_partner(user1_id), true);
|
|
assert.equal(pmc.is_partner(user2_id), false);
|
|
assert.equal(pmc.is_partner(user3_id), true);
|
|
});
|
|
|
|
run_test('insert_recent_private_message', () => {
|
|
pmc.recent.insert('1', 1001);
|
|
pmc.recent.insert('2', 2001);
|
|
pmc.recent.insert('1', 3001);
|
|
|
|
// try to backdate user1's timestamp
|
|
pmc.recent.insert('1', 555);
|
|
|
|
assert.deepEqual(pmc.recent.get(), [
|
|
{user_ids_string: '1', timestamp: 3001},
|
|
{user_ids_string: '2', timestamp: 2001},
|
|
]);
|
|
|
|
assert.deepEqual(pmc.recent.get_strings(), ['1', '2']);
|
|
});
|