Skip to content

Commit

Permalink
Fix tests for Loading components. (#13291)
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcenizal committed Sep 19, 2017
1 parent 3e94b87 commit ee47d03
Show file tree
Hide file tree
Showing 8 changed files with 192 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`KuiButton is rendered 1`] = `
<button
aria-label="aria-label"
class="kuiButton testClass1 testClass2"
data-test-subj="test subject string"
>
<span
class="kuiButton__content"
>
<span />
</span>
</button>
`;
52 changes: 52 additions & 0 deletions ui_framework/src/components/icon/__snapshots__/icon.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,58 @@ exports[`KuiIcon renders type apps 1`] = `
</svg>
`;

exports[`KuiIcon renders type arrowDown 1`] = `
<svg
class="kuiIcon"
>
<title>
arrow down icon
</title>
<use
href="#arrow_down"
/>
</svg>
`;

exports[`KuiIcon renders type arrowLeft 1`] = `
<svg
class="kuiIcon"
>
<title>
arrow left icon
</title>
<use
href="#arrow_left"
/>
</svg>
`;

exports[`KuiIcon renders type arrowRight 1`] = `
<svg
class="kuiIcon"
>
<title>
arrow right icon
</title>
<use
href="#arrow_right"
/>
</svg>
`;

exports[`KuiIcon renders type arrowUp 1`] = `
<svg
class="kuiIcon"
>
<title>
arrow up icon
</title>
<use
href="#arrow_up"
/>
</svg>
`;

exports[`KuiIcon renders type cross 1`] = `
<svg
class="kuiIcon"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`KuiLoadingChart is rendered 1`] = `
<div
aria-label="aria-label"
class="kuiLoadingChart testClass1 testClass2"
data-test-subj="test subject string"
>
<div
class="kuiLoadingChart__bar"
/>
<div
class="kuiLoadingChart__bar"
/>
<div
class="kuiLoadingChart__bar"
/>
<div
class="kuiLoadingChart__bar"
/>
</div>
`;

exports[`KuiLoadingChart mono is rendered 1`] = `
<div
class="kuiLoadingChart kuiLoadingChart--mono"
>
<div
class="kuiLoadingChart__bar"
/>
<div
class="kuiLoadingChart__bar"
/>
<div
class="kuiLoadingChart__bar"
/>
<div
class="kuiLoadingChart__bar"
/>
</div>
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`KuiLoadingKibana is rendered 1`] = `
<div
aria-label="aria-label"
class="kuiLoadingKibana testClass1 testClass2"
data-test-subj="test subject string"
>
<div
class="kuiLoadingKibana__icon"
>
<svg
class="kuiIcon"
>
<title>
kibana logo icon
</title>
<use
href="#logo"
/>
</svg>
</div>
</div>
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`KuiLoadingSpinner is rendered 1`] = `
<div
aria-label="aria-label"
class="kuiLoadingSpinner testClass1 testClass2"
data-test-subj="test subject string"
/>
`;
25 changes: 25 additions & 0 deletions ui_framework/src/components/loading/loading_chart.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react';
import { render } from 'enzyme';
import { requiredProps } from '../../test/required_props';

import { KuiLoadingChart } from './loading_chart';

describe('KuiLoadingChart', () => {
test('is rendered', () => {
const component = render(
<KuiLoadingChart { ...requiredProps } />
);

expect(component)
.toMatchSnapshot();
});

test('mono is rendered', () => {
const component = render(
<KuiLoadingChart mono />
);

expect(component)
.toMatchSnapshot();
});
});
16 changes: 16 additions & 0 deletions ui_framework/src/components/loading/loading_kibana.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react';
import { render } from 'enzyme';
import { requiredProps } from '../../test/required_props';

import { KuiLoadingKibana } from './loading_kibana';

describe('KuiLoadingKibana', () => {
test('is rendered', () => {
const component = render(
<KuiLoadingKibana { ...requiredProps } />
);

expect(component)
.toMatchSnapshot();
});
});
12 changes: 10 additions & 2 deletions ui_framework/src/components/tabs/__snapshots__/tab.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ exports[`KuiTab renders 1`] = `
class="kuiTab testClass1 testClass2"
data-test-subj="test subject string"
>
children
<span
class="kuiTab__content"
>
children
</span>
</button>
`;

Expand All @@ -16,6 +20,10 @@ exports[`KuiTab renders isSelected 1`] = `
class="kuiTab testClass1 testClass2 kuiTab-isSelected"
data-test-subj="test subject string"
>
children
<span
class="kuiTab__content"
>
children
</span>
</button>
`;

0 comments on commit ee47d03

Please sign in to comment.