Commit 711137cb by Aman Sharma

Added first e2e test

parent 0247105d
{ {
"name": "rails_react_recipe", "name": "rails_react_recipe",
"private": true, "private": true,
"scripts": {
"test": "jest",
"test-watch": "jest --watch"
},
"dependencies": { "dependencies": {
"@babel/preset-react": "^7.10.4", "@babel/preset-react": "^7.10.4",
"@rails/webpacker": "4.3.0", "@rails/webpacker": "4.3.0",
...@@ -16,5 +20,10 @@ ...@@ -16,5 +20,10 @@
"devDependencies": { "devDependencies": {
"jest": "^26.4.2", "jest": "^26.4.2",
"webpack-dev-server": "^3.11.0" "webpack-dev-server": "^3.11.0"
},
"jest": {
"roots": [
"test/javascript"
]
} }
} }
require "rails_helper" describe "GET '/' - from API", :type => :feature do
it 'checks the application renders or not' do
RSpec.feature "Application Running", :type => :feature do visit('http://localhost:3000/')
scenario "Application should run respond to view recipe button" do expect(page.title).to eq("RailsReactRecipe")
visit "/"
click_button "View Recipes"
expect(page).to have_text("Recipes for every occasion")
end end
end end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment