Skip to content

Commit db3949b

Browse files
committed
Modify tests
1 parent e703d2b commit db3949b

File tree

12 files changed

+26
-22
lines changed

12 files changed

+26
-22
lines changed

__tests__/content-body.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ describe('Description Component', () => {
1111
it('should render with text prop and wihtout optional prop', () => {
1212
const wrapper = shallow(<ContentBody title="2018">Hello World</ContentBody>);
1313
expect(wrapper.children).to.be.a('function');
14-
expect(wrapper.find('.timeline__container__body__title').text()).to.be.equal('2018');
14+
expect(wrapper.find('.title-body-component').text()).to.be.equal('2018');
1515
});
1616
});

__tests__/content-year.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ Enzyme.configure({ adapter: new Adapter() });
1010
describe('Description Component', () => {
1111
it('should render with text prop and wihtout optional prop', () => {
1212
const wrapper = shallow(<ContentYear year="hello" />);
13-
expect(wrapper.find('.timeline__container__year__item').text()).to.be.equal('hello');
13+
expect(wrapper.find('.item-year-component').text()).to.be.equal('hello');
1414
});
1515
});

__tests__/content.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ describe('Description Component', () => {
1111
it('should render with text prop and wihtout optional prop', () => {
1212
const wrapper = shallow(<Content>Hello World</Content>);
1313
expect(wrapper.children).to.be.a('function');
14-
expect(wrapper.find('.timeline__container').text()).to.be.equal('Hello World');
14+
expect(wrapper.find('.content-component').text()).to.be.equal('Hello World');
1515
});
1616
});

__tests__/description.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ Enzyme.configure({ adapter: new Adapter() });
1010
describe('Description Component', () => {
1111
it('should render with text prop and wihtout optional prop', () => {
1212
const wrapper = shallow(<Description text="hello" />);
13-
expect(wrapper.find('.timeline__container__body__description__text').text()).to.be.equal('hello');
13+
expect(wrapper.find('.text-description-component').text()).to.be.equal('hello');
1414
});
1515

1616
it('should render with text prop and optional prop', () => {
1717
const wrapper = shallow(<Description text="hello" optional="world" />);
18-
expect(wrapper.find('.timeline__container__body__description__optional').text()).to.be.equal('world');
18+
expect(wrapper.find('.optional-description-component').text()).to.be.equal('world');
1919
});
2020
});

__tests__/timeline.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ describe('Timeline Component', () => {
1111
it('should render with children', () => {
1212
const wrapper = shallow(<Timeline>Hello</Timeline>);
1313
expect(wrapper.children).to.be.a('function');
14-
expect(wrapper.find('.timeline').text()).to.be.equal('Hello');
14+
expect(wrapper.find('.timeline-component').text()).to.be.equal('Hello');
1515
});
1616
});

build/index.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"scripts": {
1313
"build": "webpack --mode production",
1414
"lint": "npm run lint:js",
15-
"lint:js": "eslint ./src/components/ --ignore-path .gitignore --fix",
15+
"lint:js": "eslint ./src/components/ --ignore-path .gitignore",
16+
"lint:js-fix": "eslint ./src/components/ --ignore-path .gitignore --fix",
1617
"start": "webpack --mode development --watch",
1718
"test": "jest",
1819
"test:coveralls": "jest --coverage --coverageReporters=text-lcov | coveralls",

src/components/content/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const ContainerComponent = styled.div`
77
line-height: 1;
88
99
&:last-child {
10-
.body-content {
10+
.body-component {
1111
&::before {
1212
display: none;
1313
}
@@ -22,7 +22,7 @@ const Content = (props) => {
2222
} = props;
2323

2424
return (
25-
<ContainerComponent>
25+
<ContainerComponent className="content-component">
2626
{ children }
2727
</ContainerComponent>
2828
);

src/components/content_body/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ const ContentBody = (props) => {
3939
} = props;
4040

4141
return (
42-
<BodyComponent className="body-content">
43-
<BodyComponentTitle>
42+
<BodyComponent className="body-component">
43+
<BodyComponentTitle className="title-body-component">
4444
{ title }
4545
</BodyComponentTitle>
4646
{ children }

src/components/content_year/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ const ContentYear = (props) => {
3232
} = props;
3333

3434
return (
35-
<YearComponent>
36-
<YearComponentItem>
35+
<YearComponent className="year-component">
36+
<YearComponentItem className="item-year-component">
3737
{ year }
3838
</YearComponentItem>
3939
</YearComponent>

0 commit comments

Comments
 (0)