Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix tests for child rendering
  • Loading branch information
Allen Smith committed Aug 25, 2017
1 parent 9c94b31 commit 7b5efa8
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion test/button-group-spec.js
Expand Up @@ -33,7 +33,7 @@ describe('ButtonGroup', () => {
it('should render children', () => {
let myButton = new Button({ text: 'My Button' }, [])
let myButtonGroup = new ButtonGroup({}, [myButton]);
expect(myButtonGroup.element.children[0].tagName).to.equal('BUTTON');
expect(myButtonGroup.children[0].element.tagName).to.equal('BUTTON');
});

});
Expand Down
2 changes: 1 addition & 1 deletion test/form-actions-spec.js
Expand Up @@ -33,7 +33,7 @@ describe('FormActions', () => {
it('should render children elements', () => {
let myButton = new Button({ text: 'Submit' }, [])
let myActions = new FormActions({}, [myButton]);
expect(myActions.element.children[0].tagName).to.equal('BUTTON');
expect(myActions.children[0].element.tagName).to.equal('BUTTON');
});

});
Expand Down
2 changes: 1 addition & 1 deletion test/form-group-spec.js
Expand Up @@ -33,7 +33,7 @@ describe('FormGroup', () => {
it('should render children', () => {
let myLabel = new Label({ text: 'My Label' }, [])
let myFormGroup = new FormGroup({}, [myLabel]);
expect(myFormGroup.element.children[0].tagName).to.equal('LABEL');
expect(myFormGroup.children[0].element.tagName).to.equal('LABEL');
});

});
Expand Down
4 changes: 2 additions & 2 deletions test/list-group-item-spec.js
Expand Up @@ -35,8 +35,8 @@ describe('ListGroupItem', () => {
let myImage = new Image({ src: 'file.jpg', pull: 'left'}, []);
let myBody = new MediaBody({ title: 'My body', text: 'My text'}, []);
let myItem = new ListGroupItem({}, [myImage, myBody]);
expect(myItem.element.children[0].tagName).to.equal('IMG');
expect(myItem.element.children[1].tagName).to.equal('DIV');
expect(myItem.children[0].element.tagName).to.equal('IMG');
expect(myItem.children[1].element.tagName).to.equal('DIV');
});

});
Expand Down
2 changes: 1 addition & 1 deletion test/list-group-spec.js
Expand Up @@ -35,7 +35,7 @@ describe('ListGroup', () => {
let myImage = new Image({ src: 'test.jpg' }, []);
let myItem = new ListGroupItem({}, [myImage]);
let myListGroup = new ListGroup({}, [myItem]);
expect(myListGroup.element.children[0].tagName).to.equal('LI');
expect(myListGroup.children[0].element.tagName).to.equal('LI');
});

});
Expand Down
6 changes: 3 additions & 3 deletions test/nav-group-spec.js
Expand Up @@ -39,14 +39,14 @@ describe('NavGroup', () => {
it('should not render a title unless specified', () => {
let myItem = new NavGroupItem({}, [])
let myNavGroup = new NavGroup({}, [myItem]);
expect(myNavGroup.element.children[0].tagName).to.be.oneOf(['A', 'SPAN']);
expect(myNavGroup.children[0].element.tagName).to.be.oneOf(['A', 'SPAN']);
});

it('should render children', () => {
let myItem = new NavGroupItem({ text: 'My Item' }, []);
let myNavGroup = new NavGroup({}, [myItem]);
expect(myNavGroup.element.children[0].tagName).to.equal('SPAN');
expect(myNavGroup.element.children[0].className).to.include('nav-group-item');
expect(myNavGroup.children[0].element.tagName).to.equal('SPAN');
expect(myNavGroup.children[0].element.className).to.include('nav-group-item');
});

});
Expand Down
4 changes: 2 additions & 2 deletions test/pane-group-spec.js
Expand Up @@ -33,8 +33,8 @@ describe('PaneGroup', () => {
it('should render children', () => {
let myPane = new Pane({ text: 'My Pane' }, [])
let myPaneGroup = new PaneGroup({}, [myPane]);
expect(myPaneGroup.element.children[0].tagName).to.equal('DIV');
expect(myPaneGroup.element.children[0].className).to.include('pane')
expect(myPaneGroup.children[0].element.tagName).to.equal('DIV');
expect(myPaneGroup.children[0].element.className).to.include('pane')
});

});
Expand Down
2 changes: 1 addition & 1 deletion test/pane-spec.js
Expand Up @@ -43,7 +43,7 @@ describe('Pane', () => {
it('should render children', () => {
let myButton = new Button({ text: 'Button' }, []);
let myPane = new Pane({}, [myButton]);
expect(myPane.element.children[0].tagName).to.equal('BUTTON');
expect(myPane.children[0].element.tagName).to.equal('BUTTON');
});

});
Expand Down
2 changes: 1 addition & 1 deletion test/select-spec.js
Expand Up @@ -32,7 +32,7 @@ describe('Select', () => {

it('Should render children as option tags', () => {
let mySelect = new Select({}, ['Option 1', 'Option 2', 'Option 3']);
expect(mySelect.element.children.length).to.equal(3);
expect(mySelect.element.childNodes.length).to.equal(3);
expect(mySelect.element.children[0].tagName).to.equal('OPTION')
expect(mySelect.element.children[0].textContent).to.equal('Option 1')
});
Expand Down
4 changes: 2 additions & 2 deletions test/tab-group-spec.js
Expand Up @@ -33,8 +33,8 @@ describe('TabGroup', () => {
it('should render children elements', () => {
let myTab = new TabItem({ text: 'Test Tab', active: true }, [])
let myGroup = new TabGroup({}, [myTab]);
expect(myGroup.element.children[0].tagName).to.equal('DIV');
expect(myGroup.element.children[0].className).to.contain('tab-item');
expect(myGroup.children[0].element.tagName).to.equal('DIV');
expect(myGroup.children[0].element.className).to.contain('tab-item');
});

});
Expand Down

0 comments on commit 7b5efa8

Please sign in to comment.