Skip to content

Commit

Permalink
added endToEnd.test.js & puppeteer config
Browse files Browse the repository at this point in the history
  • Loading branch information
lainercoder committed Dec 17, 2019
1 parent 0b04bf6 commit 509f7b8
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 175 deletions.
10 changes: 8 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{
"presets": ["@babel/preset-env", "@babel/preset-react"]
}
"presets": [
"@babel/preset-env",
"@babel/preset-react"
],
"plugins": [
"@babel/plugin-transform-runtime"
]
}
9 changes: 7 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ module.exports = {
"env": {
"browser": true,
"es6": true,
"node": true
"node": true,
"jest": true
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
"SharedArrayBuffer": "readonly",
page: true,
browser: true,
context: true,
jestPuppeteer: true,
},
"parserOptions": {
sourceType: 'module',
Expand Down
44 changes: 32 additions & 12 deletions client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,35 @@ import { Provider } from 'react-redux';
import store from './store';
import { BrowserRouter as Router, Switch, Route } from 'react-router-dom';

ReactDOM.render(
<Provider store={store}>
<Router>
<Switch>
<Route path="/products/:id">
<AppContainer />
</Route>
</Switch>
</Router>
</Provider>,
document.getElementById('app')
);
const App = () => (<Provider store={store}>
<Router>
<Switch>
<Route path="/products/:id">
<AppContainer />
</Route>
</Switch>
</Router>
</Provider>)

// console.log("env" + process.env.REACT_APP_IS_E2E_TEST)
// if (process.env.REACT_APP_IS_E2E_TEST) {
// console.log("ready for e2e test")
// const el = Enzyme.mount(<App />, { attachTo: document.getElementById('app') });
// window.el = el;
// } else {
ReactDOM.render(<App />, document.getElementById('app'));
// }


// ReactDOM.render(
// <Provider store={store}>
// <Router>
// <Switch>
// <Route path="/products/:id">
// <AppContainer />
// </Route>
// </Switch>
// </Router>
// </Provider>,
// document.getElementById('app')
// );
25 changes: 0 additions & 25 deletions dist/0.bundle.js

This file was deleted.

149 changes: 21 additions & 128 deletions dist/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,87 +10,7 @@
|/ \__/(_______/\_______)(_______/ )_( \_______)
*/

html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video,
input,
button,
span {
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video, input, button, span {
margin: 0;
padding: 0;
border: 0;
Expand All @@ -100,17 +20,7 @@ span {
font-family: 'Open Sans', sans-serif;
}

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
display: block;
}

Expand All @@ -119,20 +29,15 @@ body {
font-size: 8pt;
}

ol,
ul {
ol, ul {
list-style: none;
}

blockquote,
q {
blockquote, q {
quotes: none;
}

blockquote:before,
blockquote:after,
q:before,
q:after {
blockquote:before, blockquote:after, q:before, q:after {
content: '';
content: none;
}
Expand All @@ -159,8 +64,7 @@ a:focus {
text-decoration: none;
}

a:hover,
a:active {
a:hover, a:active {
text-decoration: none;
}

Expand Down Expand Up @@ -295,11 +199,7 @@ label {
display: flex;
}

input[type='email'],
input[type='text'],
input[type='number'],
textarea,
select {
input[type='email'], input[type='text'], input[type='number'], textarea, select {
border: var(--color) 1px solid;
padding: 0.5em;
}
Expand Down Expand Up @@ -393,8 +293,7 @@ select {
justify-content: right;
}

#left-description,
#right-description {
#left-description, #right-description {
text-align: left;
}

Expand Down Expand Up @@ -492,8 +391,7 @@ select {
justify-content: center;
}

#selected-style i {
}
#selected-style i {}

/*
_______ _________ _______ _______ __________________ _______ _______ _______
Expand Down Expand Up @@ -631,7 +529,7 @@ select {
/* border: black 1px solid; */
margin: 10px 5px 5px 10px;
max-height: 60vh;
overflow: scroll;
overflow-y: scroll;
}

#question-container {
Expand All @@ -658,19 +556,19 @@ select {
margin: 10px 0px 0px 0px;
}

.answers > span > #first {
.answers>span>#first {
margin: 1em 0px;
}

.answers > span > #more {
.answers>span>#more {
margin: 2em 0px 0.7em 15px;
}

.answers > span > #answerer {
.answers>span>#answerer {
margin-left: 15px;
}

.answers > #load-more {
.answers>#load-more {
margin-top: 1.2em;
margin-left: 15px;
font-size: 0.8em;
Expand All @@ -684,8 +582,7 @@ select {
height: 50px;
}

#add-question-form > input,
#add-question-form > textarea {
#add-question-form>input, #add-question-form>textarea {
width: 400px;
}

Expand All @@ -697,6 +594,7 @@ select {
img.uploadIcon {
content: url('./img/upload.svg') !important;
}

/*
_______ _______ _________ _______ _______
( ____ )( ____ \|\ /|\__ __/( ____ \|\ /|( ____ \
Expand All @@ -709,14 +607,11 @@ img.uploadIcon {
*/

#size-rating-container,
#comfort-rating-container,
#star-stats-container {
#size-rating-container, #comfort-rating-container, #star-stats-container {
margin: 10px 5px 5px 10px;
}

#review-list-container,
#review-stats-container {
#review-list-container, #review-stats-container {
margin: 10px 5px 5px 10px;
}

Expand All @@ -729,8 +624,7 @@ img.uploadIcon {
height: 800px;
}

#review-list-container {
}
#review-list-container {}

.review_item {
border: black 1px solid;
Expand Down Expand Up @@ -901,11 +795,10 @@ img.uploadIcon {
color: red;
}

#add-review-form > input,
#add-review-form > textarea {
#add-review-form>input, #add-review-form>textarea {
width: 400px;
}

#add-review-form {
overflow: scroll;
}
}
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"jest": {
"setupFilesAfterEnv": [
"<rootDir>tests/setupTests.js"
]
],
"verbose": true
},
"scripts": {
"test": "jest",
Expand All @@ -29,6 +30,7 @@
"dependencies": {
"@brainhubeu/react-carousel": "^1.10.30",
"axios": "^0.19.0",
"babel-polyfill": "^6.26.0",
"body-parser": "^1.19.0",
"cloudinary": "^1.18.1",
"dotenv": "^8.2.0",
Expand All @@ -44,6 +46,7 @@
"react-redux": "^7.1.3",
"react-responsive-carousel": "^3.1.51",
"react-router-dom": "^5.1.2",
"react-scripts": "^3.3.0",
"react-slick": "^0.25.2",
"redux": "^4.0.4",
"redux-devtools-extension": "^2.13.8",
Expand All @@ -55,6 +58,7 @@
},
"devDependencies": {
"@babel/core": "^7.7.5",
"@babel/plugin-transform-runtime": "^7.7.6",
"@babel/preset-env": "^7.7.6",
"@babel/preset-react": "^7.7.4",
"babel-loader": "^8.0.6",
Expand All @@ -65,6 +69,7 @@
"jest": "^24.9.0",
"jest-cli": "^24.9.0",
"jest-puppeteer": "^4.3.0",
"puppeteer": "^2.0.0",
"style-loader": "^1.0.1",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10"
Expand Down
Loading

0 comments on commit 509f7b8

Please sign in to comment.