Commit 9bf293a2 authored by Clement Ho's avatar Clement Ho

Fix variable list karma specs

parent abe3e1cf
......@@ -77,9 +77,9 @@ describe('setupSecretValues', () => {
const placeholders = wrapper.querySelectorAll('.js-secret-value-placeholder');
expect(values.length).toEqual(1);
expect(values[0].classList.contains('hidden')).toEqual(true);
expect(values[0].classList.contains('hide')).toEqual(true);
expect(placeholders.length).toEqual(1);
expect(placeholders[0].classList.contains('hidden')).toEqual(false);
expect(placeholders[0].classList.contains('hide')).toEqual(false);
});
it('should toggle value and placeholder', () => {
......@@ -91,16 +91,16 @@ describe('setupSecretValues', () => {
revealButton.click();
expect(values.length).toEqual(1);
expect(values[0].classList.contains('hidden')).toEqual(false);
expect(values[0].classList.contains('hide')).toEqual(false);
expect(placeholders.length).toEqual(1);
expect(placeholders[0].classList.contains('hidden')).toEqual(true);
expect(placeholders[0].classList.contains('hide')).toEqual(true);
revealButton.click();
expect(values.length).toEqual(1);
expect(values[0].classList.contains('hidden')).toEqual(true);
expect(values[0].classList.contains('hide')).toEqual(true);
expect(placeholders.length).toEqual(1);
expect(placeholders[0].classList.contains('hidden')).toEqual(false);
expect(placeholders[0].classList.contains('hide')).toEqual(false);
});
});
......@@ -128,11 +128,11 @@ describe('setupSecretValues', () => {
expect(values.length).toEqual(3);
values.forEach((value) => {
expect(value.classList.contains('hidden')).toEqual(true);
expect(value.classList.contains('hide')).toEqual(true);
});
expect(placeholders.length).toEqual(3);
placeholders.forEach((placeholder) => {
expect(placeholder.classList.contains('hidden')).toEqual(false);
expect(placeholder.classList.contains('hide')).toEqual(false);
});
});
......@@ -146,22 +146,22 @@ describe('setupSecretValues', () => {
expect(values.length).toEqual(3);
values.forEach((value) => {
expect(value.classList.contains('hidden')).toEqual(false);
expect(value.classList.contains('hide')).toEqual(false);
});
expect(placeholders.length).toEqual(3);
placeholders.forEach((placeholder) => {
expect(placeholder.classList.contains('hidden')).toEqual(true);
expect(placeholder.classList.contains('hide')).toEqual(true);
});
revealButton.click();
expect(values.length).toEqual(3);
values.forEach((value) => {
expect(value.classList.contains('hidden')).toEqual(true);
expect(value.classList.contains('hide')).toEqual(true);
});
expect(placeholders.length).toEqual(3);
placeholders.forEach((placeholder) => {
expect(placeholder.classList.contains('hidden')).toEqual(false);
expect(placeholder.classList.contains('hide')).toEqual(false);
});
});
});
......@@ -182,22 +182,22 @@ describe('setupSecretValues', () => {
expect(values.length).toEqual(4);
values.forEach((value) => {
expect(value.classList.contains('hidden')).toEqual(false);
expect(value.classList.contains('hide')).toEqual(false);
});
expect(placeholders.length).toEqual(4);
placeholders.forEach((placeholder) => {
expect(placeholder.classList.contains('hidden')).toEqual(true);
expect(placeholder.classList.contains('hide')).toEqual(true);
});
revealButton.click();
expect(values.length).toEqual(4);
values.forEach((value) => {
expect(value.classList.contains('hidden')).toEqual(true);
expect(value.classList.contains('hide')).toEqual(true);
});
expect(placeholders.length).toEqual(4);
placeholders.forEach((placeholder) => {
expect(placeholder.classList.contains('hidden')).toEqual(false);
expect(placeholder.classList.contains('hide')).toEqual(false);
});
});
});
......@@ -220,9 +220,9 @@ describe('setupSecretValues', () => {
revealButton.click();
expect(values.length).toEqual(1);
expect(values[0].classList.contains('hidden')).toEqual(false);
expect(values[0].classList.contains('hide')).toEqual(false);
expect(placeholders.length).toEqual(1);
expect(placeholders[0].classList.contains('hidden')).toEqual(true);
expect(placeholders[0].classList.contains('hide')).toEqual(true);
});
});
});
......@@ -4,7 +4,7 @@ import axios from '~/lib/utils/axios_utils';
import AjaxFormVariableList from '~/ci_variable_list/ajax_variable_list';
const VARIABLE_PATCH_ENDPOINT = 'http://test.host/frontend-fixtures/builds-project/variables';
const HIDE_CLASS = 'hidden';
const HIDE_CLASS = 'hide';
describe('AjaxFormVariableList', () => {
preloadFixtures('projects/ci_cd_settings.html.raw');
......
......@@ -2,7 +2,7 @@ import $ from 'jquery';
import VariableList from '~/ci_variable_list/ci_variable_list';
import getSetTimeoutPromise from 'spec/helpers/set_timeout_promise_helper';
const HIDE_CLASS = 'hidden';
const HIDE_CLASS = 'hide';
describe('VariableList', () => {
preloadFixtures('pipeline_schedules/edit.html.raw');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment