Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Merge remote-tracking branch 'origin/login-page-acceptance-tests' int…
…o feature/individual-page
- Loading branch information
Showing
13 changed files
with
326 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
#!/bin/sh | ||
|
||
echo "running the 'pre-commit' script" | ||
|
||
echo "running eslint..." | ||
./node_modules/.bin/eslint . | ||
|
||
echo "running tests..." | ||
npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use strict' | ||
|
||
const fs = require('fs') | ||
|
||
async function runSQLScript(db, filename) { | ||
return new Promise((resolve, reject) => { | ||
fs.readFile(filename, 'utf8', async(err, sql) => { | ||
if (err) { | ||
return reject(err) | ||
} | ||
resolve(db.exec(sql)) | ||
}) | ||
}) | ||
} | ||
|
||
module.exports = { | ||
runSQLScript | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -16,5 +16,6 @@ module.exports = { | ||
testPathIgnorePatterns: [ | ||
'/node_modules/', | ||
'/__tests__/fixtures/', | ||
'/tests/test.js' | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Feature: Login Page | ||
|
||
User should be able to log in and access user only parts | ||
|
||
Scenario: User logs in successfully | ||
Given username is 'admin' and password is 'hello' | ||
When I try to log in | ||
Then I should be logged in successfully | ||
Then I should be redirected to '/' | ||
|
||
Scenario: User provides incorrect password | ||
Given username is 'admin' and password is 'nothello' | ||
When I try to log in | ||
Then I should be asked to try again with an error telling me the password was incorrect | ||
|
||
Scenario: User provides incorrect username | ||
Given username is 'notadmin' and password is 'hello' | ||
When I try to log in | ||
Then I should be asked to try again with an error telling me the username doesn't exist |
Oops, something went wrong.