mattermost-mobile-upstream/app/client/rest/base.test.ts
Daniel Espino García 993115d2a0
[MM-67923] Add channel settings for shared channels (#9591)
* [MM-67923] Add channel settings for shared channels

* Fix toggle and tests

* Address client types

* Add failure state to channel share screen

* Better handle errors on save

* Remove unneeded database fetch inside the component

* Fix i18n

* Disable interactions while saving

* Fix test

* Address coderabbit comments

* Add e2e tests

* Address feedback

* Address codeRabbit comments

* Update detox/e2e/test/products/channels/channel_settings/share_with_connected_workspaces.e2e.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Address comments

* Address coderabbit comments

* Address reviews and several UI defects

* Fix tests

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
2026-04-14 11:43:44 +02:00

41 lines
1.5 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import TestHelper from '@test/test_helper';
import type ClientBase from './base';
import type {ClientChannelsMix} from './channels';
describe('ClientBase route methods', () => {
let client: ClientChannelsMix & ClientBase;
beforeAll(() => {
client = TestHelper.createClient();
});
describe('shared channels and remote cluster routes', () => {
test('getSharedChannelsRoute returns sharedchannels path', () => {
expect(client.getSharedChannelsRoute()).toBe(`${client.urlVersion}/sharedchannels`);
});
test('getRemoteClustersRoute returns remotecluster path', () => {
expect(client.getRemoteClustersRoute()).toBe(`${client.urlVersion}/remotecluster`);
});
test('getChannelRemotesRoute returns channel remotes path', () => {
const channelId = 'channel-id-1';
expect(client.getChannelRemotesRoute(channelId)).toBe(
`${client.urlVersion}/sharedchannels/${channelId}/remotes`,
);
});
test('getRemoteClusterChannelRoute returns remote cluster channel path', () => {
const remoteId = 'remote-id-1';
const channelId = 'channel-id-1';
expect(client.getRemoteClusterChannelRoute(remoteId, channelId)).toBe(
`${client.urlVersion}/remotecluster/${remoteId}/channels/${channelId}`,
);
});
});
});