kafka-ui/kafka-ui-react-app/src/lib/__tests__/paths.spec.ts
Oleg Shur 0921ae1f59
[#288] Allow users to use name :new for topics and schemas (#351)
* [#288] Allow users to use name :new for topics and schemas

* Remove unused imports
2021-04-05 14:55:47 +03:00

69 lines
1.9 KiB
TypeScript

import { GIT_REPO_LINK } from 'lib/constants';
import * as paths from '../paths';
describe('Paths', () => {
it('gitCommitPath', () => {
expect(paths.gitCommitPath('1234567gh')).toEqual(
`${GIT_REPO_LINK}/commit/1234567gh`
);
});
it('clusterBrokersPath', () => {
expect(paths.clusterBrokersPath('local')).toEqual(
'/ui/clusters/local/brokers'
);
});
it('clusterConsumerGroupsPath', () => {
expect(paths.clusterConsumerGroupsPath('local')).toEqual(
'/ui/clusters/local/consumer-groups'
);
});
it('clusterSchemasPath', () => {
expect(paths.clusterSchemasPath('local')).toEqual(
'/ui/clusters/local/schemas'
);
});
it('clusterSchemaNewPath', () => {
expect(paths.clusterSchemaNewPath('local')).toEqual(
'/ui/clusters/local/schemas/create_new'
);
});
it('clusterSchemaPath', () => {
expect(paths.clusterSchemaPath('local', 'schema123')).toEqual(
'/ui/clusters/local/schemas/schema123/latest'
);
});
it('clusterTopicsPath', () => {
expect(paths.clusterTopicsPath('local')).toEqual(
'/ui/clusters/local/topics'
);
});
it('clusterTopicNewPath', () => {
expect(paths.clusterTopicNewPath('local')).toEqual(
'/ui/clusters/local/topics/create_new'
);
});
it('clusterTopicPath', () => {
expect(paths.clusterTopicPath('local', 'topic123')).toEqual(
'/ui/clusters/local/topics/topic123'
);
});
it('clusterTopicSettingsPath', () => {
expect(paths.clusterTopicSettingsPath('local', 'topic123')).toEqual(
'/ui/clusters/local/topics/topic123/settings'
);
});
it('clusterTopicMessagesPath', () => {
expect(paths.clusterTopicMessagesPath('local', 'topic123')).toEqual(
'/ui/clusters/local/topics/topic123/messages'
);
});
it('clusterTopicsTopicEditPath', () => {
expect(paths.clusterTopicsTopicEditPath('local', 'topic123')).toEqual(
'/ui/clusters/local/topics/topic123/edit'
);
});
});