Skip to content

Commit

Permalink
add e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Billmike committed Mar 14, 2018
1 parent 51a4fc1 commit 30990ad
Show file tree
Hide file tree
Showing 45 changed files with 1,025 additions and 132 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"class-methods-use-this": 0,
"prefer-default-export": "off",
"import/no-named-as-default": "off",
"import/no-extraneous-dependencies": "off",
"one-var": 0,
"no-unused-expressions": "off",
"no-unused-vars": "off",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`<AddRecipe /> Should render correctly 1`] = `
<div>
<div
id="AddRecipeDiv"
>
<h1
className="container add-h1"
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`<EditRecipe /> Should render EditRecipe component correctly 1`] = `
<div>
<div
id="editRecipeID"
>
<h1
className="container add-h1"
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`<Favorites /> Should render the Favorites component 1`] = `
<div>
<div
id="favorites-container"
>
<div
className="container"
>
Expand Down Expand Up @@ -32,6 +34,7 @@ exports[`<Favorites /> Should render the Favorites component 1`] = `
. Checkout some recipes
<Link
id="addFavoritesLink"
replace={false}
to="/"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
exports[`<LoginForm /> Should render the form correctly 1`] = `
<div
className="container"
id="loginContainer"
>
<div
className="card text-center card-form has-feedback"
Expand All @@ -11,6 +12,7 @@ exports[`<LoginForm /> Should render the form correctly 1`] = `
className="card-body"
>
<form
id="loginFormBody"
onSubmit={[Function]}
>
<h1
Expand Down Expand Up @@ -49,6 +51,7 @@ exports[`<LoginForm /> Should render the form correctly 1`] = `
<div />
<input
className="btn submit-btn size-bt btn-block"
id="submitButton"
type="submit"
value="Submit"
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`<RecipeDetails Component Should render the recipe details component properly 1`] = `
<div>
<div
id="recipe-detail-ID"
>
<div>
<h4
className="recipe-detail-name"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ exports[`<RecipesForm/> Should render error for an invalid form submission 1`] =
>
<form
className=""
id="recipe-form-ID"
onSubmit={[Function]}
>
<div
Expand Down Expand Up @@ -69,6 +70,7 @@ exports[`<RecipesForm/> Should render error for an invalid form submission 1`] =
disableClick={false}
disablePreview={false}
disabled={false}
id="dropZoneID"
maxSize={Infinity}
minSize={0}
multiple={false}
Expand Down Expand Up @@ -142,7 +144,7 @@ exports[`<RecipesForm/> Should render error for an invalid form submission 1`] =
<textarea
aria-describedby="recipeNameHelp"
className="form-control large-text"
id="recipename"
id="recipeingredients"
name="ingredients"
onChange={[Function]}
value=""
Expand Down Expand Up @@ -178,15 +180,13 @@ exports[`<RecipesForm/> Should render error for an invalid form submission 1`] =
Enter your step-by-step Instructions.
</small>
</div>
<LoaderComp
loaded={true}
/>
</div>
<div
className="form-group"
>
<button
className="btn btn-primary my-btn button-font btn-lg btn-block"
id="recipe-submit-button"
>
Submit Recipe
</button>
Expand All @@ -203,6 +203,7 @@ exports[`<RecipesForm/> Should render the RecipesForm with recipes 1`] = `
>
<form
className=""
id="recipe-form-ID"
onSubmit={[Function]}
>
<div
Expand Down Expand Up @@ -265,6 +266,7 @@ exports[`<RecipesForm/> Should render the RecipesForm with recipes 1`] = `
disableClick={false}
disablePreview={false}
disabled={false}
id="dropZoneID"
maxSize={Infinity}
minSize={0}
multiple={false}
Expand Down Expand Up @@ -338,7 +340,7 @@ exports[`<RecipesForm/> Should render the RecipesForm with recipes 1`] = `
<textarea
aria-describedby="recipeNameHelp"
className="form-control large-text"
id="recipename"
id="recipeingredients"
name="ingredients"
onChange={[Function]}
value="Bread
Expand Down Expand Up @@ -377,15 +379,13 @@ Avoid mixing with water"
Enter your step-by-step Instructions.
</small>
</div>
<LoaderComp
loaded={true}
/>
</div>
<div
className="form-group"
>
<button
className="btn btn-primary my-btn button-font btn-lg btn-block"
id="recipe-submit-button"
>
Submit Recipe
</button>
Expand All @@ -402,6 +402,7 @@ exports[`<RecipesForm/> Should render the recipe form correctly 1`] = `
>
<form
className=""
id="recipe-form-ID"
onSubmit={[Function]}
>
<div
Expand Down Expand Up @@ -464,6 +465,7 @@ exports[`<RecipesForm/> Should render the recipe form correctly 1`] = `
disableClick={false}
disablePreview={false}
disabled={false}
id="dropZoneID"
maxSize={Infinity}
minSize={0}
multiple={false}
Expand Down Expand Up @@ -537,7 +539,7 @@ exports[`<RecipesForm/> Should render the recipe form correctly 1`] = `
<textarea
aria-describedby="recipeNameHelp"
className="form-control large-text"
id="recipename"
id="recipeingredients"
name="ingredients"
onChange={[Function]}
value=""
Expand Down Expand Up @@ -573,15 +575,13 @@ exports[`<RecipesForm/> Should render the recipe form correctly 1`] = `
Enter your step-by-step Instructions.
</small>
</div>
<LoaderComp
loaded={true}
/>
</div>
<div
className="form-group"
>
<button
className="btn btn-primary my-btn button-font btn-lg btn-block"
id="recipe-submit-button"
>
Submit Recipe
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ exports[`<ReviewForm /> Should render the review form correctly 1`] = `
>
<textarea
className="form-control review-form"
id="reviewFormId"
placeholder="Enter a review for this recipe"
/>
<button
className="btn btn-primary btn-lg btn-block form-button"
id="submit-review"
>
Submit review
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ exports[`<SignupForm component /> Should render the sign-up form correctly 1`] =
className="card-body"
>
<form
id="submitSignupForm"
onSubmit={[Function]}
>
<h1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ exports[`<UserLinks /> Should render the UserLinks component correctly 1`] = `
>
<Link
className="nav-link custom-link"
id="home-button"
replace={false}
to="/"
>
Expand Down Expand Up @@ -36,6 +37,7 @@ exports[`<UserLinks /> Should render the UserLinks component correctly 1`] = `
>
<Link
className="nav-link custom-link"
id="addRecipeID"
replace={false}
to="/add"
>
Expand All @@ -45,6 +47,7 @@ exports[`<UserLinks /> Should render the UserLinks component correctly 1`] = `
<li>
<Link
className="nav-link custom-link"
id="favoritesButton"
replace={false}
to="/favorites"
>
Expand All @@ -67,6 +70,7 @@ exports[`<UserLinks /> Should render the UserLinks component correctly 1`] = `
>
<Link
className="nav-link logout btn-primary"
id="logoutButton"
replace={false}
to="/"
>
Expand Down
10 changes: 8 additions & 2 deletions client/src/actionCreators/addRecipe.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { ADD_RECIPE } from '../actions/types';
import { ADD_RECIPE, ADD_RECIPE_REQUEST } from '../actions/types';

export const addRecipeRequest = () => ({
type: ADD_RECIPE_REQUEST,
isLoading: true
});

/**
* Represents a function
Expand All @@ -11,7 +16,8 @@ import { ADD_RECIPE } from '../actions/types';

const addRecipe = recipe => ({
type: ADD_RECIPE,
recipe
recipe,
isLoading: false
});

export default addRecipe;
8 changes: 7 additions & 1 deletion client/src/actionCreators/addReview.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { ADD_REVIEW } from '../actions/types';
import { ADD_REVIEW, ADD_REVIEW_REQUEST } from '../actions/types';


export const addReviewRequest = () => ({
type: ADD_REVIEW_REQUEST,
isLoading: true
});
/**
* Represents a function
* @function
Expand All @@ -12,6 +17,7 @@ import { ADD_REVIEW } from '../actions/types';
const addReview = review => ({
type: ADD_REVIEW,
review,
isLoading: false
});

export default addReview;
10 changes: 8 additions & 2 deletions client/src/actionCreators/getAllRecipes.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { GET_RECIPES } from '../actions/types';
import { GET_RECIPES, GET_RECIPES_REQUEST } from '../actions/types';

export const getAllRecipesRequest = () => ({
type: GET_RECIPES_REQUEST,
isLoading: true
});

/**
* Represents a function
Expand All @@ -12,7 +17,8 @@ import { GET_RECIPES } from '../actions/types';
const getAllRecipes = (recipes, pagination) => ({
type: GET_RECIPES,
recipes,
pagination
pagination,
isLoading: false
});

export default getAllRecipes;
10 changes: 8 additions & 2 deletions client/src/actionCreators/getUserRecipe.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { GET_USER_RECIPES } from '../actions/types';
import { GET_USER_RECIPES, GET_USER_RECIPES_REQUEST } from '../actions/types';

export const getUserRecipeRequest = () => ({
type: GET_USER_RECIPES_REQUEST,
isLoading: true
});

/**
* Represents a function
Expand All @@ -11,7 +16,8 @@ import { GET_USER_RECIPES } from '../actions/types';

const getUserRecipe = userRecipe => ({
type: GET_USER_RECIPES,
userRecipe
userRecipe,
isLoading: false
});

export default getUserRecipe;
Loading

0 comments on commit 30990ad

Please sign in to comment.