mattermost-mobile-upstream/app/client/rest/base.test.ts
Daniel Espino García d3c9b8b1c4
Fix link to image proxy and correct padding in image sizing on blocks (#9976)
* Fix link to image proxy and correct padding in image sizing on blocks

* Clamp layout width

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2026-07-30 13:41:26 +02:00

45 lines
1.7 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();
});
test('getAPIRoute joins base route and api version', () => {
expect(client.getAPIRoute()).toBe(`${client.getBaseRoute()}${client.urlVersion}`);
});
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}`,
);
});
});
});