Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
f7fe4d48
Commit
f7fe4d48
authored
Jan 27, 2020
by
Lukas Siatka
Committed by
Lukas Siatka
Jan 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Explore: adds MetaInfoText tests
parent
61b5471e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
0 deletions
+52
-0
public/app/features/explore/MetaInfoText.test.tsx
+34
-0
public/app/features/explore/__snapshots__/MetaInfoText.test.tsx.snap
+18
-0
No files found.
public/app/features/explore/MetaInfoText.test.tsx
0 → 100644
View file @
f7fe4d48
import
React
from
'react'
;
import
{
shallow
,
render
}
from
'enzyme'
;
import
{
MetaInfoText
,
MetaItemProps
}
from
'./MetaInfoText'
;
describe
(
'MetaInfoText'
,
()
=>
{
it
(
'should render component'
,
()
=>
{
const
items
:
MetaItemProps
[]
=
[
{
label
:
'label'
,
value
:
'value'
},
{
label
:
'label2'
,
value
:
'value2'
},
];
const
wrapper
=
shallow
(<
MetaInfoText
metaItems=
{
items
}
/>);
expect
(
wrapper
).
toMatchSnapshot
();
});
it
(
'should render items'
,
()
=>
{
const
items
:
MetaItemProps
[]
=
[
{
label
:
'label'
,
value
:
'value'
},
{
label
:
'label2'
,
value
:
'value2'
},
];
const
wrapper
=
render
(<
MetaInfoText
metaItems=
{
items
}
/>);
expect
(
wrapper
.
find
(
'label'
)).
toBeTruthy
();
expect
(
wrapper
.
find
(
'value'
)).
toBeTruthy
();
expect
(
wrapper
.
find
(
'label2'
)).
toBeTruthy
();
expect
(
wrapper
.
find
(
'value2'
)).
toBeTruthy
();
});
it
(
'should render no items when the array is empty'
,
()
=>
{
const
items
:
MetaItemProps
[]
=
[];
const
wrapper
=
shallow
(<
MetaInfoText
metaItems=
{
items
}
/>);
expect
(
wrapper
.
find
(
'div'
).
exists
()).
toBeTruthy
();
expect
(
wrapper
.
find
(
'div'
).
children
()).
toHaveLength
(
0
);
});
});
public/app/features/explore/__snapshots__/MetaInfoText.test.tsx.snap
0 → 100644
View file @
f7fe4d48
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`MetaInfoText should render component 1`] = `
<div
className="css-mi7ebz"
>
<Component
key="0-label"
label="label"
value="value"
/>
<Component
key="1-label2"
label="label2"
value="value2"
/>
</div>
`;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment