Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 583ba35

Browse files
Fix JS tests
1 parent 50d36d2 commit 583ba35

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

‎client/app/bundles/comments/components/CommentBox/CommentList/Comment/Comment.spec.jsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ describe('Comment', () => {
2020
// const author = findRenderedDOMComponentWithTag(component, 'h2');
2121
// expect(author.className).to.equal('comment-author');
2222
const text = findRenderedDOMComponentWithTag(component, 'span');
23-
expect(text.className).to.equal('comment-text');
23+
expect(text.className).to.equal('js-comment-text');
2424
});
2525

2626
it('shows the author', () => {
2727
const component = renderIntoDocument(
2828
<Comment author="Frank" text="Hi!"/>
2929
);
3030

31-
const author = findRenderedDOMComponentWithClass(component, 'comment-author');
31+
const author = findRenderedDOMComponentWithClass(component, 'js-comment-author');
3232
expect(author.textContent).to.equal('Frank');
3333
});
3434

@@ -37,7 +37,7 @@ describe('Comment', () => {
3737
<Comment author="Frank" text="Hi!"/>
3838
);
3939

40-
const comment = findRenderedDOMComponentWithClass(component, 'comment-text');
40+
const comment = findRenderedDOMComponentWithClass(component, 'js-comment-text');
4141
expect(comment.textContent).to.equal('Hi!\n');
4242
});
4343
});

‎client/app/libs/testNullCompiler.js‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const noop = () => null;
2+
3+
require.extensions['.css'] = noop;
4+
require.extensions['.scss'] = noop;
5+
require.extensions['.png'] = noop;
6+
require.extensions['.jpg'] = noop;
7+
require.extensions['.jpeg'] = noop;
8+
require.extensions['.gif'] = noop;

‎client/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
},
2525
"homepage": "https://github.com/shakacode/react-webpack-rails-tutorial",
2626
"scripts": {
27-
"test": "NODE_PATH=./app mocha --compilers js:babel-core/register --require ./app/libs/testHelper.js 'app/**/*.spec.@(js|jsx)'",
27+
"test": "NODE_PATH=./app mocha --compilers js:babel-core/register --require ./app/libs/testHelper.js --require ./app/libs/testNullCompiler.js 'app/**/*.spec.@(js|jsx)'",
2828
"test:debug": "npm run test -- --debug-brk",
2929
"start": "node server.js",
3030
"build:client": "NODE_ENV=production webpack --config webpack.client.rails.build.config.js",

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /