From 19b530e5cf302c290629b34af606cdaf7e319535 Mon Sep 17 00:00:00 2001 From: abdurrahmanekr Date: Sun, 30 Jul 2017 23:17:42 +0300 Subject: [PATCH] standart structure added. --- .gitignore | 12 ++++++ assets/css/MessageBox.css | 3 ++ package.json | 41 +++++++++++++++++++ src/MessageBox/MessageBox.js | 7 ++++ src/MessageBox/__tests__/MessageBox.js | 13 ++++++ .../__snapshots__/MessageBox.js.snap | 3 ++ src/index.js | 10 +++++ 7 files changed, 89 insertions(+) create mode 100644 .gitignore create mode 100644 assets/css/MessageBox.css create mode 100644 package.json create mode 100644 src/MessageBox/MessageBox.js create mode 100644 src/MessageBox/__tests__/MessageBox.js create mode 100644 src/MessageBox/__tests__/__snapshots__/MessageBox.js.snap create mode 100644 src/index.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..1ff04e54 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +dependencies +/node_modules + +# testing +/coverage + +# misc +.DS_Store +.env +npm-debug.log* +yarn-debug.log* +yarn-error.log* \ No newline at end of file diff --git a/assets/css/MessageBox.css b/assets/css/MessageBox.css new file mode 100644 index 00000000..a76c2156 --- /dev/null +++ b/assets/css/MessageBox.css @@ -0,0 +1,3 @@ +.rcs-messagebox: { + padding: 10px 15px; +} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 00000000..44b5d801 --- /dev/null +++ b/package.json @@ -0,0 +1,41 @@ +{ + "name": "react-chat-elements", + "version": "0.1.0", + "description": "Reactjs chat components", + "author": "Avare Kodcu ", + "main": "src/index.js", + "devDependencies": { + "react": "^15.6.1", + "enzyme": "^2.9.1", + "enzyme-to-json": "^1.5.1", + "react-dom": "^15.6.1", + "react-scripts": "^1.0.10", + "react-test-renderer": "^15.6.1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/abdurrahmanekr/react-chat-elements.git" + }, + "keywords": [ + "react", + "reactjs", + "chat", + "css", + "chat", + "components" + ], + "license": "MIT", + "jest": { + "snapshotSerializers": [ + "/node_modules/enzyme-to-json/serializer" + ] + }, + "bugs": { + "url": "https://github.com/abdurrahmanekr/react-chat-elements/issues" + }, + "homepage": "https://github.com/abdurrahmanekr/react-chat-elements#readme", + "scripts": { + "test": "react-scripts test --env=jsdom", + "test:coverage": "npm run test -- --coverage --collectCoverageFrom=src/**/*.js --collectCoverageFrom=!src/index.js" + } +} diff --git a/src/MessageBox/MessageBox.js b/src/MessageBox/MessageBox.js new file mode 100644 index 00000000..62cd1c0e --- /dev/null +++ b/src/MessageBox/MessageBox.js @@ -0,0 +1,7 @@ +import React from 'react'; + +const MessageBox = () => ( +
+); + +module.exports = MessageBox; \ No newline at end of file diff --git a/src/MessageBox/__tests__/MessageBox.js b/src/MessageBox/__tests__/MessageBox.js new file mode 100644 index 00000000..3819a524 --- /dev/null +++ b/src/MessageBox/__tests__/MessageBox.js @@ -0,0 +1,13 @@ +import React, { Component } from 'react'; +import { shallow } from 'enzyme'; +import toJson from 'enzyme-to-json'; +import MessageBox from '../MessageBox'; + +describe('MessageBox component', () => { + it('should render without issues', () => { + const component = shallow(); + + expect(component.length).toBe(1); + expect(toJson(component)).toMatchSnapshot(); + }); +}); \ No newline at end of file diff --git a/src/MessageBox/__tests__/__snapshots__/MessageBox.js.snap b/src/MessageBox/__tests__/__snapshots__/MessageBox.js.snap new file mode 100644 index 00000000..3ce1cafa --- /dev/null +++ b/src/MessageBox/__tests__/__snapshots__/MessageBox.js.snap @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`MessageBox component should render without issues 1`] = `
`; diff --git a/src/index.js b/src/index.js new file mode 100644 index 00000000..7a1b6d1a --- /dev/null +++ b/src/index.js @@ -0,0 +1,10 @@ +/* import css */ +import '../assets/css'; + +/* import components */ +import MessageBox from './MessageBox.js'; + + +export { + MessageBox +}; \ No newline at end of file