Skip to content

Commit deed896

Browse files
committed
update segment test
1 parent 74ab2e8 commit deed896

1 file changed

Lines changed: 7 additions & 13 deletions

File tree

test/specs/elements/Segment/Segment-test.js

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,16 @@ import React from 'react';
22
import {Segment} from 'stardust';
33

44
describe('Segment', () => {
5-
it('is an sd-segment', () => {
6-
const segmentElement = <Segment heading='This is a segment' />;
7-
const renderedSegmentClasses = render(segmentElement).findClass('sd-segment').props.className;
8-
renderedSegmentClasses.should.contain('sd-segment');
9-
const nodeClass = render(segmentElement).findClass('sd-segment').getDOMNode().getAttribute('class');
10-
nodeClass.should.contain('sd-segment');
11-
});
125
it('does not have a heading', () => {
13-
const renderedSegment = render(<Segment />);
14-
expect(renderedSegment.first().props.heading).to.not.exist;
15-
renderedSegment.scryClass('sd-segment-heading').should.be.empty;
6+
render(<Segment />)
7+
.scryClass('sd-segment-heading')
8+
.should.have.length(0);
169
});
1710
it('has a heading', () => {
18-
const segment = render(<Segment heading='This is a segment' />);
19-
segment.findClass('sd-segment-heading');
20-
segment.assertText('This is a segment');
11+
render(<Segment heading='This is a segment' />)
12+
.findClass('sd-segment-heading')
13+
.textContent
14+
.should.equal('This is a segment');
2115
});
2216
it('renders its children', () => {
2317
render(<Segment>Some text</Segment>)

0 commit comments

Comments
 (0)