123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- import { GIT_REPO_LINK } from 'lib/constants';
- import * as paths from 'lib/paths';
- const clusterName = 'test-cluster-name';
- const groupId = 'test-group-id';
- const schemaId = 'test-schema-id';
- const topicId = 'test-topic-id';
- const connectName = 'test-connect-name';
- const connectorName = 'test-connector-name';
- describe('Paths', () => {
- it('gitCommitPath', () => {
- expect(paths.gitCommitPath('1234567gh')).toEqual(
- `${GIT_REPO_LINK}/commit/1234567gh`
- );
- });
- it('clusterPath', () => {
- expect(paths.clusterPath(clusterName)).toEqual(
- `/ui/clusters/${clusterName}`
- );
- });
- it('clusterBrokersPath', () => {
- expect(paths.clusterBrokersPath(clusterName)).toEqual(
- `${paths.clusterPath(clusterName)}/brokers`
- );
- });
- it('clusterConsumerGroupsPath', () => {
- expect(paths.clusterConsumerGroupsPath(clusterName)).toEqual(
- `${paths.clusterPath(clusterName)}/consumer-groups`
- );
- });
- it('clusterConsumerGroupDetailsPath', () => {
- expect(paths.clusterConsumerGroupDetailsPath(clusterName, groupId)).toEqual(
- `${paths.clusterConsumerGroupsPath(clusterName)}/${groupId}`
- );
- });
- it('clusterConsumerGroupResetOffsetsPath', () => {
- expect(
- paths.clusterConsumerGroupResetOffsetsPath(clusterName, groupId)
- ).toEqual(
- `${paths.clusterConsumerGroupDetailsPath(
- clusterName,
- groupId
- )}/reset-offsets`
- );
- });
- it('clusterSchemasPath', () => {
- expect(paths.clusterSchemasPath(clusterName)).toEqual(
- `${paths.clusterPath(clusterName)}/schemas`
- );
- });
- it('clusterSchemaNewPath', () => {
- expect(paths.clusterSchemaNewPath(clusterName)).toEqual(
- `${paths.clusterSchemasPath(clusterName)}/create-new`
- );
- });
- it('clusterSchemaPath', () => {
- expect(paths.clusterSchemaPath(clusterName, schemaId)).toEqual(
- `${paths.clusterSchemasPath(clusterName)}/${schemaId}`
- );
- });
- it('clusterSchemaEditPath', () => {
- expect(paths.clusterSchemaEditPath(clusterName, schemaId)).toEqual(
- `${paths.clusterSchemaPath(clusterName, schemaId)}/edit`
- );
- });
- it('clusterTopicsPath', () => {
- expect(paths.clusterTopicsPath(clusterName)).toEqual(
- `${paths.clusterPath(clusterName)}/topics`
- );
- });
- it('clusterTopicNewPath', () => {
- expect(paths.clusterTopicNewPath(clusterName)).toEqual(
- `${paths.clusterTopicsPath(clusterName)}/create-new`
- );
- });
- it('clusterTopicPath', () => {
- expect(paths.clusterTopicPath(clusterName, topicId)).toEqual(
- `${paths.clusterTopicsPath(clusterName)}/${topicId}`
- );
- });
- it('clusterTopicSettingsPath', () => {
- expect(paths.clusterTopicSettingsPath(clusterName, topicId)).toEqual(
- `${paths.clusterTopicPath(clusterName, topicId)}/settings`
- );
- });
- it('clusterTopicConsumerGroupsPath', () => {
- expect(paths.clusterTopicConsumerGroupsPath(clusterName, topicId)).toEqual(
- `${paths.clusterTopicPath(clusterName, topicId)}/consumer-groups`
- );
- });
- it('clusterTopicMessagesPath', () => {
- expect(paths.clusterTopicMessagesPath(clusterName, topicId)).toEqual(
- `${paths.clusterTopicPath(clusterName, topicId)}/messages`
- );
- });
- it('clusterTopicSendMessagePath', () => {
- expect(paths.clusterTopicSendMessagePath(clusterName, topicId)).toEqual(
- `${paths.clusterTopicPath(clusterName, topicId)}/message`
- );
- });
- it('clusterTopicEditPath', () => {
- expect(paths.clusterTopicEditPath(clusterName, topicId)).toEqual(
- `${paths.clusterTopicPath(clusterName, topicId)}/edit`
- );
- });
- it('clusterConnectsPath', () => {
- expect(paths.clusterConnectsPath(clusterName)).toEqual(
- `${paths.clusterPath(clusterName)}/connects`
- );
- });
- it('clusterConnectorsPath', () => {
- expect(paths.clusterConnectorsPath(clusterName)).toEqual(
- `${paths.clusterPath(clusterName)}/connectors`
- );
- });
- it('clusterConnectorNewPath', () => {
- expect(paths.clusterConnectorNewPath(clusterName)).toEqual(
- `${paths.clusterConnectorsPath(clusterName)}/create-new`
- );
- });
- it('clusterConnectConnectorPath', () => {
- expect(
- paths.clusterConnectConnectorPath(clusterName, connectName, connectorName)
- ).toEqual(
- `${paths.clusterConnectsPath(
- clusterName
- )}/${connectName}/connectors/${connectorName}`
- );
- });
- it('clusterConnectConnectorEditPath', () => {
- expect(
- paths.clusterConnectConnectorEditPath(
- clusterName,
- connectName,
- connectorName
- )
- ).toEqual(
- `${paths.clusterConnectConnectorPath(
- clusterName,
- connectName,
- connectorName
- )}/edit`
- );
- });
- it('clusterConnectConnectorTasksPath', () => {
- expect(
- paths.clusterConnectConnectorTasksPath(
- clusterName,
- connectName,
- connectorName
- )
- ).toEqual(
- `${paths.clusterConnectConnectorPath(
- clusterName,
- connectName,
- connectorName
- )}/tasks`
- );
- });
- it('clusterConnectConnectorConfigPath', () => {
- expect(
- paths.clusterConnectConnectorConfigPath(
- clusterName,
- connectName,
- connectorName
- )
- ).toEqual(
- `${paths.clusterConnectConnectorPath(
- clusterName,
- connectName,
- connectorName
- )}/config`
- );
- });
- it('clusterKsqlDbPath', () => {
- expect(paths.clusterKsqlDbPath(clusterName)).toEqual(
- `${paths.clusterPath(clusterName)}/ksqldb`
- );
- });
- it('clusterKsqlDbPath with default value', () => {
- expect(paths.clusterKsqlDbPath()).toEqual(
- `${paths.clusterPath(':clusterName')}/ksqldb`
- );
- });
- it('clusterKsqlDbQueryPath', () => {
- expect(paths.clusterKsqlDbQueryPath(clusterName)).toEqual(
- `${paths.clusterKsqlDbPath(clusterName)}/query`
- );
- });
- it('clusterKsqlDbQueryPath with default value', () => {
- expect(paths.clusterKsqlDbQueryPath()).toEqual(
- `${paths.clusterKsqlDbPath(':clusterName')}/query`
- );
- });
- });
|