Skip to content

Commit 9439c3e

Browse files
committed
fixing import and test definitions
1 parent ecf7b02 commit 9439c3e

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

x-pack/legacy/plugins/canvas/common/lib/dataurl.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ const RAW_PIXEL =
2222

2323
describe('dataurl', () => {
2424
describe('isValidDataUrl', () => {
25-
it('invalid data url', () => {
25+
it('returns false for an invalid data url', () => {
2626
expect(isValidDataUrl('somestring')).toBe(false);
2727
});
28-
it('empty string returns false', () => {
28+
it('returns false for an empty string', () => {
2929
expect(isValidDataUrl('')).toBe(false);
3030
});
31-
it('valid data urls', () => {
31+
it('returns true for valid data urls', () => {
3232
expect(isValidDataUrl(BASE64_TEXT)).toBe(true);
3333
expect(isValidDataUrl(BASE64_SVG)).toBe(true);
3434
expect(isValidDataUrl(BASE64_PIXEL)).toBe(true);
@@ -39,13 +39,13 @@ describe('dataurl', () => {
3939
});
4040

4141
describe('dataurl.parseDataUrl', () => {
42-
it('invalid data url', () => {
42+
it('returns null for an invalid data url', () => {
4343
expect(parseDataUrl('somestring')).toBeNull();
4444
});
45-
it('invalid base64 image returns null', () => {
45+
it('returns null for an invalid base64 image', () => {
4646
expect(parseDataUrl(INVALID_BASE64_PIXEL)).toBeNull();
4747
});
48-
it('text data urls', () => {
48+
it('returns correct values for text data urls', () => {
4949
expect(parseDataUrl(BASE64_TEXT)).toEqual({
5050
charset: 'utf-8',
5151
data: null,
@@ -63,7 +63,7 @@ describe('dataurl', () => {
6363
mimetype: 'text/plain',
6464
});
6565
});
66-
it('png data urls', () => {
66+
it('returns correct values for png data urls', () => {
6767
expect(parseDataUrl(RAW_PIXEL)).toBeNull();
6868
expect(parseDataUrl(BASE64_PIXEL)).toEqual({
6969
charset: undefined,
@@ -74,7 +74,7 @@ describe('dataurl', () => {
7474
mimetype: 'image/png',
7575
});
7676
});
77-
it('svg data urls', () => {
77+
it('returns correct values for svg data urls', () => {
7878
expect(parseDataUrl(RAW_SVG)).toEqual({
7979
charset: undefined,
8080
data: null,

x-pack/legacy/plugins/canvas/common/lib/get_colors_from_palette.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
* you may not use this file except in compliance with the Elastic License.
55
*/
66

7-
import { getColorsFromPalette } from './get_colors_from_palette';
87
import {
98
grayscalePalette,
109
gradientPalette,
11-
} from './../../canvas_plugin_src/functions/common/__tests__/fixtures/test_styles';
10+
} from '../../canvas_plugin_src/functions/common/__tests__/fixtures/test_styles';
11+
import { getColorsFromPalette } from './get_colors_from_palette';
1212

1313
describe('getColorsFromPalette', () => {
1414
it('returns the array of colors from a palette object when gradient is false', () => {

x-pack/legacy/plugins/canvas/common/lib/get_field_type.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
* you may not use this file except in compliance with the Elastic License.
55
*/
66

7-
import { getFieldType } from './get_field_type';
87
import {
98
emptyTable,
109
testTable,
11-
} from './../../canvas_plugin_src/functions/common/__tests__/fixtures/test_tables';
10+
} from '../../canvas_plugin_src/functions/common/__tests__/fixtures/test_tables';
11+
import { getFieldType } from './get_field_type';
1212

1313
describe('getFieldType', () => {
1414
it('returns type of a field in a datatable', () => {

x-pack/legacy/plugins/canvas/common/lib/handlebars.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* you may not use this file except in compliance with the Elastic License.
55
*/
66

7+
import { testTable } from '../../canvas_plugin_src/functions/common/__tests__/fixtures/test_tables';
78
import { Handlebars } from './handlebars';
8-
import { testTable } from './../../canvas_plugin_src/functions/common/__tests__/fixtures/test_tables';
99

1010
describe('handlebars', () => {
1111
it('registers math function and returns argument error', () => {

x-pack/legacy/plugins/canvas/common/lib/hex_to_rgb.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77
import { hexToRgb } from './hex_to_rgb';
88

99
describe('hexToRgb', () => {
10-
it('invalid hex', () => {
10+
it('returns null for an invalid hex', () => {
1111
expect(hexToRgb('hexadecimal')).toBeNull();
1212
expect(hexToRgb('#00')).toBeNull();
1313
expect(hexToRgb('#00000')).toBeNull();
1414
});
15-
it('shorthand', () => {
15+
it('returns correct value for shorthand hex codes', () => {
1616
expect(hexToRgb('#000')).toEqual([0, 0, 0]);
1717
expect(hexToRgb('#FFF')).toEqual([255, 255, 255]);
1818
expect(hexToRgb('#fff')).toEqual([255, 255, 255]);
1919
expect(hexToRgb('#fFf')).toEqual([255, 255, 255]);
2020
});
21-
it('longhand', () => {
21+
it('returns correct value for longhand hex codes', () => {
2222
expect(hexToRgb('#000000')).toEqual([0, 0, 0]);
2323
expect(hexToRgb('#ffffff')).toEqual([255, 255, 255]);
2424
expect(hexToRgb('#fffFFF')).toEqual([255, 255, 255]);

x-pack/legacy/plugins/canvas/common/lib/resolve_dataurl.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* you may not use this file except in compliance with the Elastic License.
55
*/
66

7+
import { missingImage } from '../../common/lib/missing_asset';
78
import { resolveFromArgs, resolveWithMissingImage } from './resolve_dataurl';
8-
import { missingImage } from './../../common/lib/missing_asset';
99

1010
describe('resolve_dataurl', () => {
1111
describe('resolveFromArgs', () => {

x-pack/legacy/plugins/canvas/common/lib/url.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* you may not use this file except in compliance with the Elastic License.
55
*/
66

7+
import { missingImage } from '../../common/lib/missing_asset';
78
import { isValidUrl } from './url';
8-
import { missingImage } from './../../common/lib/missing_asset';
99

1010
describe('resolve_dataurl', () => {
1111
it('returns valid dataurl', () => {

0 commit comments

Comments
 (0)