* Remove mattermost-redux * Move mm-redux files into app/redux * Add @redux path to tsconfig.json * Fix imports * Install missing dependencies * Fix tsc errors * Fix i18n_utils test * Fix more imports * Remove redux websocket * Fix tests * Rename @redux * Apply changes from mattermost-redux PR 1103 * Remove mattermost-redux mention in template * Add missing imports * Rename app/redux/ to app/mm-redux/ * Remove test file * Fix fetching Sidebar GM profiles Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
38 lines
1.3 KiB
JavaScript
38 lines
1.3 KiB
JavaScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {Client4} from '@mm-redux/client';
|
|
|
|
import {cleanUrlForLogging} from 'app/utils/sentry';
|
|
|
|
/* eslint-disable max-nested-callbacks */
|
|
|
|
describe('utils/sentry', () => {
|
|
describe('cleanUrlForLogging', () => {
|
|
Client4.setUrl('https://mattermost.example.com/subpath');
|
|
|
|
const tests = [{
|
|
name: 'should remove server URL',
|
|
input: Client4.getUserRoute('me'),
|
|
expected: `${Client4.urlVersion}/users/me`,
|
|
}, {
|
|
name: 'should filter user IDs',
|
|
input: Client4.getUserRoute('1234'),
|
|
expected: `${Client4.urlVersion}/users/<filtered>`,
|
|
}, {
|
|
name: 'should filter email addresses',
|
|
input: `${Client4.getUsersRoute()}/email/test@example.com`,
|
|
expected: `${Client4.urlVersion}/users/email/<filtered>`,
|
|
}, {
|
|
name: 'should filter query parameters',
|
|
input: `${Client4.getUserRoute('me')}?foo=bar`,
|
|
expected: `${Client4.urlVersion}/users/me?<filtered>`,
|
|
}];
|
|
|
|
for (const test of tests) {
|
|
it(test.name, () => {
|
|
expect(cleanUrlForLogging(test.input)).toEqual(test.expected);
|
|
});
|
|
}
|
|
});
|
|
});
|