-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
6f8052e
commit a66c29b
Showing
16 changed files
with
152 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,38 @@ | ||
import { LoggingURLService } from './index'; | ||
|
||
describe('testing link-creation LoggingURLService', () => { | ||
it('should successfully create OpenSearch url based on given baseURL and namespace params', () => { | ||
it('should successfully create OpenSearch url', () => { | ||
expect( | ||
LoggingURLService.createDashboardLink( | ||
'opensearch', | ||
'https://kibana-test.com', | ||
'test-namespace' | ||
) | ||
LoggingURLService.createDashboardLink({ | ||
provider: 'opensearch', | ||
baseURL: 'https://opensearch-test.com', | ||
namespace: 'test-namespace', | ||
}) | ||
).toEqual( | ||
"https://kibana-test.com/app/discover#/?_g=()&_a=(columns:!(log),filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,key:kubernetes.namespace_name,negate:!f,params:(query:test-namespace),type:phrase),query:(match_phrase:(kubernetes.namespace_name:test-namespace)))),interval:auto,query:(language:kuery,query:''),sort:!(!('@timestamp',desc)))" | ||
"https://opensearch-test.com/app/discover#/?_g=()&_a=(columns:!(log),filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,key:kubernetes.namespace_name,negate:!f,params:(query:test-namespace),type:phrase),query:(match_phrase:(kubernetes.namespace_name:test-namespace)))),interval:auto,query:(language:kuery,query:''),sort:!(!('@timestamp',desc)))" | ||
); | ||
}); | ||
|
||
it('should successfully create Datadog url', () => { | ||
expect( | ||
LoggingURLService.createDashboardLink({ | ||
provider: 'datadog', | ||
baseURL: 'https://datadog-test.com', | ||
namespace: 'test-namespace', | ||
clusterName: 'test-cluster-name', | ||
}) | ||
).toEqual( | ||
'https://datadog-test.com/logs?query=cluster_name%3Atest-cluster-name%20kube_namespace%3Atest-namespace' | ||
); | ||
}); | ||
|
||
it('should successfully return baseURL if provider is unknown', () => { | ||
expect( | ||
LoggingURLService.createDashboardLink( | ||
'some-provider', | ||
'https://kibana-test.com', | ||
'test-namespace' | ||
) | ||
).toEqual('https://kibana-test.com'); | ||
LoggingURLService.createDashboardLink({ | ||
provider: 'some-provider', | ||
baseURL: 'https://opensearch-test.com', | ||
namespace: 'test-namespace', | ||
}) | ||
).toEqual('https://opensearch-test.com'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.