Fix activity spec
This commit is contained in:
parent
8cdc066ff9
commit
2c203185a0
|
@ -1,12 +1,12 @@
|
|||
import React from 'react';
|
||||
import { assert} from 'chai';
|
||||
import { assert } from 'chai';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import {Activity} from '../../main/js/components/Activity.jsx';
|
||||
import { Activity } from '../../main/js/components/Activity.jsx';
|
||||
|
||||
const
|
||||
data = [
|
||||
{
|
||||
{
|
||||
"changeSet": [],
|
||||
"durationInMillis": 64617,
|
||||
"enQueueTime": "2016-03-04T13:59:53.272+0100",
|
||||
|
@ -129,10 +129,19 @@ const
|
|||
}
|
||||
];
|
||||
|
||||
const pipeline = {
|
||||
_class: "some.class"
|
||||
}
|
||||
|
||||
const capabilities = {
|
||||
'some.class':{
|
||||
has: () => true
|
||||
}
|
||||
}
|
||||
describe("Activity should render", () => {
|
||||
|
||||
it("does renders the Activity with data", () => {
|
||||
const wrapper = shallow(<Activity runs={data} />);
|
||||
const wrapper = shallow(<Activity runs={data} pipeline={pipeline} capabilities={capabilities}/>);
|
||||
// does data renders?
|
||||
assert.isNotNull(wrapper)
|
||||
assert.equal(wrapper.find('Runs').length, data.length)
|
||||
|
@ -142,14 +151,14 @@ describe("Activity should render", () => {
|
|||
|
||||
describe("Activity should not render", () => {
|
||||
it("does not renders the Activity without data", () => {
|
||||
const wrapper = shallow(<Activity />).node;
|
||||
const wrapper = shallow(<Activity pipeline={pipeline} capabilities={capabilities}/>).node;
|
||||
assert.isNull(wrapper);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Pipeline -> Activity List', () => {
|
||||
it('should not duplicate changeset messages', () => {
|
||||
const wrapper = shallow(<Activity runs={data} />);
|
||||
const wrapper = shallow(<Activity runs={data} pipeline={pipeline} capabilities={capabilities} />);
|
||||
assert.isNotNull(wrapper);
|
||||
|
||||
const runs = wrapper.find('Runs');
|
||||
|
|
Loading…
Reference in New Issue