mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
* PLT-5860 Updated copyright date in about modal * PLT-5860 Updated copyright notice in JSX files * PLT-5860 Updated copyright notice in go files * Fixed misc copyright dates * Fixed component snapshots
63 lines
1.9 KiB
JavaScript
63 lines
1.9 KiB
JavaScript
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
|
// See License.txt for license information.
|
|
|
|
import TestHelper from 'tests/helpers/client-test-helper.jsx';
|
|
|
|
describe('Client.Preferences', function() {
|
|
test('getAllPreferences', function(done) {
|
|
TestHelper.initBasic(done, () => {
|
|
TestHelper.basicClient().getAllPreferences(
|
|
function(data) {
|
|
expect(data[0].category).toBe('tutorial_step');
|
|
expect(data[0].user_id).toEqual(TestHelper.basicUser().id);
|
|
done();
|
|
},
|
|
function(err) {
|
|
done.fail(new Error(err.message));
|
|
}
|
|
);
|
|
});
|
|
});
|
|
|
|
test('savePreferences', function(done) {
|
|
TestHelper.initBasic(done, () => {
|
|
var perf = {};
|
|
perf.user_id = TestHelper.basicUser().id;
|
|
perf.category = 'test';
|
|
perf.name = 'name';
|
|
perf.value = 'value';
|
|
|
|
var perfs = [];
|
|
perfs.push(perf);
|
|
|
|
TestHelper.basicClient().savePreferences(
|
|
perfs,
|
|
function(data) {
|
|
expect(data).toBe(true);
|
|
done();
|
|
},
|
|
function(err) {
|
|
done.fail(new Error(err.message));
|
|
}
|
|
);
|
|
});
|
|
});
|
|
|
|
test('getPreferenceCategory', function(done) {
|
|
TestHelper.initBasic(done, () => {
|
|
TestHelper.basicClient().getPreferenceCategory(
|
|
'tutorial_step',
|
|
function(data) {
|
|
expect(data[0].category).toBe('tutorial_step');
|
|
expect(data[0].user_id).toEqual(TestHelper.basicUser().id);
|
|
done();
|
|
},
|
|
function(err) {
|
|
done.fail(new Error(err.message));
|
|
}
|
|
);
|
|
});
|
|
});
|
|
});
|
|
|