mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
This migrates the existing webapp tests to using Jest and Enzyme. The infrastructure is put in place for React component testing, and a few simple example component tests are implemented. This also adds snapshot testing of components, coverage checking for the webapp (although that is not yet integrated to Coveralls), and the ability to run npm run test:watch to automatically re-run affected tests when working on the webapp codebase.
45 lines
1.3 KiB
JavaScript
45 lines
1.3 KiB
JavaScript
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
|
|
// See License.txt for license information.
|
|
|
|
import TestHelper from 'tests/helpers/client-test-helper.jsx';
|
|
|
|
describe('Client.General', function() {
|
|
test('General.getClientConfig', function(done) {
|
|
TestHelper.initBasic(done, () => {
|
|
TestHelper.basicClient().getClientConfig(
|
|
function(data) {
|
|
expect(data.SiteName).toEqual('Mattermost');
|
|
done();
|
|
},
|
|
function(err) {
|
|
done.fail(new Error(err.message));
|
|
}
|
|
);
|
|
});
|
|
});
|
|
|
|
test('General.getPing', function(done) {
|
|
TestHelper.initBasic(done, () => {
|
|
TestHelper.basicClient().getPing(
|
|
function(data) {
|
|
expect(data.version.length).toBeGreaterThan(0);
|
|
done();
|
|
},
|
|
function(err) {
|
|
done.fail(new Error(err.message));
|
|
}
|
|
);
|
|
});
|
|
});
|
|
|
|
test('General.logClientError', function(done) {
|
|
TestHelper.initBasic(done, () => {
|
|
var config = {};
|
|
config.site_name = 'test';
|
|
TestHelper.basicClient().logClientError('this is a test');
|
|
done();
|
|
});
|
|
});
|
|
});
|
|
|