fixing test

This commit is contained in:
Peter Holmberg 2019-02-01 14:23:03 +01:00
parent 025d37e9a2
commit 609129c039
2 changed files with 30 additions and 48 deletions

View File

@ -2,7 +2,7 @@ import React from 'react';
import { shallow } from 'enzyme'; import { shallow } from 'enzyme';
import { ValueMappingsEditor, Props } from './ValueMappingsEditor'; import { ValueMappingsEditor, Props } from './ValueMappingsEditor';
import { MappingType } from '../../types/panel'; import { MappingType } from '../../types';
const setup = (propOverrides?: object) => { const setup = (propOverrides?: object) => {
const props: Props = { const props: Props = {

View File

@ -2,55 +2,37 @@
exports[`Render should render component 1`] = ` exports[`Render should render component 1`] = `
<Component <Component
title="Value Mappings" onAdd={[Function]}
title="Add mapping"
> >
<div> <MappingRow
<MappingRow key="Ok-0"
key="Ok-0" removeValueMapping={[Function]}
removeValueMapping={[Function]} updateValueMapping={[Function]}
updateValueMapping={[Function]} valueMapping={
valueMapping={ Object {
Object { "id": 1,
"id": 1, "operator": "",
"operator": "", "text": "Ok",
"text": "Ok", "type": 1,
"type": 1, "value": "20",
"value": "20",
}
} }
/> }
<MappingRow />
key="Meh-1" <MappingRow
removeValueMapping={[Function]} key="Meh-1"
updateValueMapping={[Function]} removeValueMapping={[Function]}
valueMapping={ updateValueMapping={[Function]}
Object { valueMapping={
"from": "21", Object {
"id": 2, "from": "21",
"operator": "", "id": 2,
"text": "Meh", "operator": "",
"to": "30", "text": "Meh",
"type": 2, "to": "30",
} "type": 2,
} }
/> }
</div> />
<div
className="add-mapping-row"
onClick={[Function]}
>
<div
className="add-mapping-row-icon"
>
<i
className="fa fa-plus"
/>
</div>
<div
className="add-mapping-row-label"
>
Add mapping
</div>
</div>
</Component> </Component>
`; `;