Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/runner/runner_search_utils_spec.js')
-rw-r--r--spec/frontend/runner/runner_search_utils_spec.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/frontend/runner/runner_search_utils_spec.js b/spec/frontend/runner/runner_search_utils_spec.js
index 0fc7917663e..aff1ec882bb 100644
--- a/spec/frontend/runner/runner_search_utils_spec.js
+++ b/spec/frontend/runner/runner_search_utils_spec.js
@@ -1,6 +1,7 @@
import { RUNNER_PAGE_SIZE } from '~/runner/constants';
import {
searchValidator,
+ updateOutdatedUrl,
fromUrlQueryToSearch,
fromSearchToUrl,
fromSearchToVariables,
@@ -190,6 +191,23 @@ describe('search_params.js', () => {
});
});
+ describe('updateOutdatedUrl', () => {
+ it('returns null for urls that do not need updating', () => {
+ expect(updateOutdatedUrl('http://test.host/')).toBe(null);
+ expect(updateOutdatedUrl('http://test.host/?a=b')).toBe(null);
+ });
+
+ it('returns updated url for updating NOT_CONNECTED to NEVER_CONTACTED', () => {
+ expect(updateOutdatedUrl('http://test.host/admin/runners?status[]=NOT_CONNECTED')).toBe(
+ 'http://test.host/admin/runners?status[]=NEVER_CONTACTED',
+ );
+
+ expect(updateOutdatedUrl('http://test.host/admin/runners?status[]=NOT_CONNECTED&a=b')).toBe(
+ 'http://test.host/admin/runners?status[]=NEVER_CONTACTED&a=b',
+ );
+ });
+ });
+
describe('fromUrlQueryToSearch', () => {
examples.forEach(({ name, urlQuery, search }) => {
it(`Converts ${name} to a search object`, () => {