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:
authorMike Greiling <mike@pixelcog.com>2018-10-17 10:13:26 +0300
committerMike Greiling <mike@pixelcog.com>2018-10-17 19:18:17 +0300
commitf666026d71ebefd70219d5078b1f0c83fa01f84d (patch)
treece43feb99c12c21dd266d25de24b1768bac1d459 /spec/javascripts/filtered_search/dropdown_utils_spec.js
parent5a6fffcffca3dc8e4f52c90d3d18eaefd9e48aef (diff)
Prettify all spec files
Diffstat (limited to 'spec/javascripts/filtered_search/dropdown_utils_spec.js')
-rw-r--r--spec/javascripts/filtered_search/dropdown_utils_spec.js77
1 files changed, 50 insertions, 27 deletions
diff --git a/spec/javascripts/filtered_search/dropdown_utils_spec.js b/spec/javascripts/filtered_search/dropdown_utils_spec.js
index 52b54973047..6605b0a30d7 100644
--- a/spec/javascripts/filtered_search/dropdown_utils_spec.js
+++ b/spec/javascripts/filtered_search/dropdown_utils_spec.js
@@ -19,7 +19,7 @@ describe('Dropdown Utils', () => {
expect(escaped).toBe('"text with space"');
- escaped = DropdownUtils.getEscapedText('won\'t fix');
+ escaped = DropdownUtils.getEscapedText("won't fix");
expect(escaped).toBe('"won\'t fix"');
});
@@ -27,13 +27,13 @@ describe('Dropdown Utils', () => {
it('should escape with single quotes', () => {
const escaped = DropdownUtils.getEscapedText('won"t fix');
- expect(escaped).toBe('\'won"t fix\'');
+ expect(escaped).toBe("'won\"t fix'");
});
it('should escape with single quotes by default', () => {
const escaped = DropdownUtils.getEscapedText('won"t\' fix');
- expect(escaped).toBe('\'won"t\' fix\'');
+ expect(escaped).toBe("'won\"t' fix'");
});
});
@@ -105,7 +105,7 @@ describe('Dropdown Utils', () => {
});
it('should filter with single quote', () => {
- input.value = '\'';
+ input.value = "'";
const updatedItem = DropdownUtils.filterWithSymbol('~', input, multipleWordItem);
@@ -113,7 +113,7 @@ describe('Dropdown Utils', () => {
});
it('should filter with single quote and symbol', () => {
- input.value = '~\'';
+ input.value = "~'";
const updatedItem = DropdownUtils.filterWithSymbol('~', input, multipleWordItem);
@@ -121,7 +121,7 @@ describe('Dropdown Utils', () => {
});
it('should filter with single quote and multiple words', () => {
- input.value = '\'community con';
+ input.value = "'community con";
const updatedItem = DropdownUtils.filterWithSymbol('~', input, multipleWordItem);
@@ -129,7 +129,7 @@ describe('Dropdown Utils', () => {
});
it('should filter with single quote, symbol and multiple words', () => {
- input.value = '~\'community con';
+ input.value = "~'community con";
const updatedItem = DropdownUtils.filterWithSymbol('~', input, multipleWordItem);
@@ -246,23 +246,40 @@ describe('Dropdown Utils', () => {
it('should linear-gradient 2 colors', () => {
const gradient = DropdownUtils.duplicateLabelColor(['#FFFFFF', '#000000']);
- expect(gradient).toEqual('linear-gradient(#FFFFFF 0%, #FFFFFF 50%, #000000 50%, #000000 100%)');
+ expect(gradient).toEqual(
+ 'linear-gradient(#FFFFFF 0%, #FFFFFF 50%, #000000 50%, #000000 100%)',
+ );
});
it('should linear-gradient 3 colors', () => {
const gradient = DropdownUtils.duplicateLabelColor(['#FFFFFF', '#000000', '#333333']);
- expect(gradient).toEqual('linear-gradient(#FFFFFF 0%, #FFFFFF 33%, #000000 33%, #000000 66%, #333333 66%, #333333 100%)');
+ expect(gradient).toEqual(
+ 'linear-gradient(#FFFFFF 0%, #FFFFFF 33%, #000000 33%, #000000 66%, #333333 66%, #333333 100%)',
+ );
});
it('should linear-gradient 4 colors', () => {
- const gradient = DropdownUtils.duplicateLabelColor(['#FFFFFF', '#000000', '#333333', '#DDDDDD']);
-
- expect(gradient).toEqual('linear-gradient(#FFFFFF 0%, #FFFFFF 25%, #000000 25%, #000000 50%, #333333 50%, #333333 75%, #DDDDDD 75%, #DDDDDD 100%)');
+ const gradient = DropdownUtils.duplicateLabelColor([
+ '#FFFFFF',
+ '#000000',
+ '#333333',
+ '#DDDDDD',
+ ]);
+
+ expect(gradient).toEqual(
+ 'linear-gradient(#FFFFFF 0%, #FFFFFF 25%, #000000 25%, #000000 50%, #333333 50%, #333333 75%, #DDDDDD 75%, #DDDDDD 100%)',
+ );
});
it('should not linear-gradient more than 4 colors', () => {
- const gradient = DropdownUtils.duplicateLabelColor(['#FFFFFF', '#000000', '#333333', '#DDDDDD', '#EEEEEE']);
+ const gradient = DropdownUtils.duplicateLabelColor([
+ '#FFFFFF',
+ '#000000',
+ '#333333',
+ '#DDDDDD',
+ '#EEEEEE',
+ ]);
expect(gradient.indexOf('#EEEEEE')).toBe(-1);
});
@@ -276,13 +293,16 @@ describe('Dropdown Utils', () => {
});
it('should not mutate existing data if there are no duplicates', () => {
- const data = [{
- title: 'label1',
- color: '#FFFFFF',
- }, {
- title: 'label2',
- color: '#000000',
- }];
+ const data = [
+ {
+ title: 'label1',
+ color: '#FFFFFF',
+ },
+ {
+ title: 'label2',
+ color: '#000000',
+ },
+ ];
const results = DropdownUtils.duplicateLabelPreprocessing(data);
expect(results.length).toEqual(2);
@@ -291,13 +311,16 @@ describe('Dropdown Utils', () => {
});
describe('duplicate labels', () => {
- const data = [{
- title: 'label',
- color: '#FFFFFF',
- }, {
- title: 'label',
- color: '#000000',
- }];
+ const data = [
+ {
+ title: 'label',
+ color: '#FFFFFF',
+ },
+ {
+ title: 'label',
+ color: '#000000',
+ },
+ ];
const results = DropdownUtils.duplicateLabelPreprocessing(data);
it('should merge duplicate labels', () => {