From 5093058eda03d66421795e1a8205dee568fcf249 Mon Sep 17 00:00:00 2001 From: Louis Martin <106453870+Lou-Martin@users.noreply.github.com> Date: Mon, 12 Jun 2023 10:48:56 +0100 Subject: [PATCH 01/63] Update README.md add trello link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index eee74593d..6ff9aeaf0 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ It uses: ## Card wall -REPLACE THIS TEXT WITH A LINK TO YOUR CARD WALL +https://trello.com/b/u8jfD7dB/milton-acebook ## Quickstart From 8a6ff1921104e1040a7d9246c81c827b8c2fa3c5 Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 13 Jun 2023 10:12:17 +0100 Subject: [PATCH 02/63] testing by adding colour --- public/stylesheets/style.css | 1 + 1 file changed, 1 insertion(+) diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css index 9453385b9..f96f8fb5f 100644 --- a/public/stylesheets/style.css +++ b/public/stylesheets/style.css @@ -1,6 +1,7 @@ body { padding: 50px; font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; + background-color: bisque; } a { From ea531928840fe261eb96ae88515abd532cf66695 Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 13 Jun 2023 10:21:13 +0100 Subject: [PATCH 03/63] testing - changed colour --- public/stylesheets/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css index f96f8fb5f..bccef7208 100644 --- a/public/stylesheets/style.css +++ b/public/stylesheets/style.css @@ -1,7 +1,7 @@ body { padding: 50px; font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; - background-color: bisque; + background-color: rgb(238, 208, 170); } a { From 203ad9a14fa1616888ecbad27d1973774eebd323 Mon Sep 17 00:00:00 2001 From: Yousef Hafez Date: Tue, 13 Jun 2023 11:41:29 +0100 Subject: [PATCH 04/63] /new changed to signup, sessions changed to login --- app.js | 4 +++- controllers/home.js | 3 +++ controllers/sessions.js | 12 ++++++++---- controllers/users.js | 4 +++- models/user.js | 3 +++ routes/sessions.js | 3 ++- routes/users.js | 3 ++- views/home/index.hbs | 3 +++ views/sessions/{new.hbs => login.hbs} | 0 views/users/{new.hbs => signup.hbs} | 0 10 files changed, 27 insertions(+), 8 deletions(-) rename views/sessions/{new.hbs => login.hbs} (100%) rename views/users/{new.hbs => signup.hbs} (100%) diff --git a/app.js b/app.js index bb2057955..0f4a39b2a 100644 --- a/app.js +++ b/app.js @@ -11,6 +11,8 @@ const postsRouter = require("./routes/posts"); const sessionsRouter = require("./routes/sessions"); const usersRouter = require("./routes/users"); +// create a route for users/username + const app = express(); // view engine setup @@ -47,7 +49,7 @@ app.use((req, res, next) => { // middleware function to check for logged-in users const sessionChecker = (req, res, next) => { if (!req.session.user && !req.cookies.user_sid) { - res.redirect("/sessions/new"); + res.redirect("/sessions/login"); } else { next(); } diff --git a/controllers/home.js b/controllers/home.js index 667b4decc..e03f8d6e0 100644 --- a/controllers/home.js +++ b/controllers/home.js @@ -5,3 +5,6 @@ const HomeController = { }; module.exports = HomeController; + + +// add to this page to make the appearance more dynamic :) diff --git a/controllers/sessions.js b/controllers/sessions.js index 917e2e14c..1ea5de389 100644 --- a/controllers/sessions.js +++ b/controllers/sessions.js @@ -2,7 +2,8 @@ const User = require("../models/user"); const SessionsController = { New: (req, res) => { - res.render("sessions/new", {}); + // res.render("sessions/new", {}); + res.render("sessions/login", {}); }, Create: (req, res) => { @@ -12,9 +13,11 @@ const SessionsController = { User.findOne({ email: email }).then((user) => { if (!user) { - res.redirect("/sessions/new"); + // res.redirect("/sessions/new"); + res.redirect("/sessions/login"); } else if (user.password != password) { - res.redirect("/sessions/new"); + // res.redirect("/sessions/new"); + res.redirect("/sessions/login"); } else { req.session.user = user; res.redirect("/posts"); @@ -27,7 +30,8 @@ const SessionsController = { if (req.session.user && req.cookies.user_sid) { res.clearCookie("user_sid"); } - res.redirect("/sessions/new"); + // res.redirect("/sessions/new"); + res.redirect("/sessions/login"); }, }; diff --git a/controllers/users.js b/controllers/users.js index bdc2ea8f3..1fda78319 100644 --- a/controllers/users.js +++ b/controllers/users.js @@ -2,7 +2,9 @@ const User = require("../models/user"); const UsersController = { New: (req, res) => { - res.render("users/new", {}); + // res.render("users/new", {}); + res.render("users/signup", {}); + }, Create: (req, res) => { diff --git a/models/user.js b/models/user.js index 27406b498..deb3f4550 100644 --- a/models/user.js +++ b/models/user.js @@ -8,3 +8,6 @@ const UserSchema = new mongoose.Schema({ const User = mongoose.model("User", UserSchema); module.exports = User; + + +// need to add username to the schema \ No newline at end of file diff --git a/routes/sessions.js b/routes/sessions.js index c0783914c..4fe6455e6 100644 --- a/routes/sessions.js +++ b/routes/sessions.js @@ -3,7 +3,8 @@ const router = express.Router(); const SessionsController = require("../controllers/sessions"); -router.get("/new", SessionsController.New); +router.get("/login", SessionsController.New); +// router.get("/signup", SessionsController.New); router.post("/", SessionsController.Create); router.delete("/", SessionsController.Destroy); diff --git a/routes/users.js b/routes/users.js index 1203f91bf..2bb063df8 100644 --- a/routes/users.js +++ b/routes/users.js @@ -3,7 +3,8 @@ const router = express.Router(); const UsersController = require("../controllers/users"); -router.get("/new", UsersController.New); +// router.get("/new", UsersController.New); +router.get("/signup", UsersController.New); router.post("/", UsersController.Create); module.exports = router; diff --git a/views/home/index.hbs b/views/home/index.hbs index 7ad30d847..b197b7e15 100644 --- a/views/home/index.hbs +++ b/views/home/index.hbs @@ -1,2 +1,5 @@

{{title}}

Welcome to {{title}}

+ + +{{!-- potential additions to homepage : add a description, a picture --}} \ No newline at end of file diff --git a/views/sessions/new.hbs b/views/sessions/login.hbs similarity index 100% rename from views/sessions/new.hbs rename to views/sessions/login.hbs diff --git a/views/users/new.hbs b/views/users/signup.hbs similarity index 100% rename from views/users/new.hbs rename to views/users/signup.hbs From 4f9adbd5d21978beb67303d78f03365995302cae Mon Sep 17 00:00:00 2001 From: Barlowi2023 Date: Tue, 13 Jun 2023 13:55:25 +0100 Subject: [PATCH 05/63] corrected the tests --- cypress/integration/user_can_see_posts_count_on_post.js | 4 ++-- cypress/integration/user_can_sign_in_spec.js | 4 ++-- cypress/integration/user_can_sign_up_spec.js | 4 ++-- cypress/integration/user_can_submit_posts_spec.js | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cypress/integration/user_can_see_posts_count_on_post.js b/cypress/integration/user_can_see_posts_count_on_post.js index 203897aca..e2bfc5b0d 100644 --- a/cypress/integration/user_can_see_posts_count_on_post.js +++ b/cypress/integration/user_can_see_posts_count_on_post.js @@ -1,13 +1,13 @@ describe("Timeline", () => { it("can see likes count on a new post", () => { // sign up - cy.visit("/users/new"); + cy.visit("/users/signup"); cy.get("#email").type("someone@example.com"); cy.get("#password").type("password"); cy.get("#submit").click(); // sign in - cy.visit("/sessions/new"); + cy.visit("/sessions/login"); cy.get("#email").type("someone@example.com"); cy.get("#password").type("password"); cy.get("#submit").click(); diff --git a/cypress/integration/user_can_sign_in_spec.js b/cypress/integration/user_can_sign_in_spec.js index 2c2ae6d9a..7fee902c2 100644 --- a/cypress/integration/user_can_sign_in_spec.js +++ b/cypress/integration/user_can_sign_in_spec.js @@ -1,13 +1,13 @@ describe("Authentication", () => { it("A user signs in and is redirected to /posts", () => { // sign up - cy.visit("/users/new"); + cy.visit("/users/signup"); cy.get("#email").type("someone@example.com"); cy.get("#password").type("password"); cy.get("#submit").click(); // sign in - cy.visit("/sessions/new"); + cy.visit("/sessions/login"); cy.get("#email").type("someone@example.com"); cy.get("#password").type("password"); cy.get("#submit").click(); diff --git a/cypress/integration/user_can_sign_up_spec.js b/cypress/integration/user_can_sign_up_spec.js index 7863a66e5..771168f55 100644 --- a/cypress/integration/user_can_sign_up_spec.js +++ b/cypress/integration/user_can_sign_up_spec.js @@ -1,11 +1,11 @@ describe("Registration", () => { it("A user signs up and is redirected to sign in", () => { // sign up - cy.visit("/users/new"); + cy.visit("/users/signup"); cy.get("#email").type("someone@example.com"); cy.get("#password").type("password"); cy.get("#submit").click(); - cy.url().should("include", "/sessions/new"); + cy.url().should("include", "/sessions/login"); }); }); diff --git a/cypress/integration/user_can_submit_posts_spec.js b/cypress/integration/user_can_submit_posts_spec.js index 019075937..1d229c24c 100644 --- a/cypress/integration/user_can_submit_posts_spec.js +++ b/cypress/integration/user_can_submit_posts_spec.js @@ -1,13 +1,13 @@ describe("Timeline", () => { it("can submit posts, when signed in, and view them", () => { // sign up - cy.visit("/users/new"); + cy.visit("/users/signup"); cy.get("#email").type("someone@example.com"); cy.get("#password").type("password"); cy.get("#submit").click(); // sign in - cy.visit("/sessions/new"); + cy.visit("/sessions/login"); cy.get("#email").type("someone@example.com"); cy.get("#password").type("password"); cy.get("#submit").click(); From 2587cad458ead255a4af3de0b66692630dbcca7d Mon Sep 17 00:00:00 2001 From: Louis Date: Wed, 14 Jun 2023 10:10:15 +0100 Subject: [PATCH 06/63] branch test --- cypress/integration/test_spec.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 cypress/integration/test_spec.js diff --git a/cypress/integration/test_spec.js b/cypress/integration/test_spec.js new file mode 100644 index 000000000..cfcab9c87 --- /dev/null +++ b/cypress/integration/test_spec.js @@ -0,0 +1 @@ +//hello testers \ No newline at end of file From ccc11e7e585faabf445e4e1bb7dda1ec89806528 Mon Sep 17 00:00:00 2001 From: Louis Date: Wed, 14 Jun 2023 12:06:56 +0100 Subject: [PATCH 07/63] add cypress function to clearDB for clean test environments. add task to all relevant tests --- ... user_can_see_posts_count_on_post_spec.js} | 11 +++++---- cypress/integration/user_can_sign_in_spec.js | 2 ++ .../integration/user_can_submit_posts_spec.js | 3 +++ cypress/plugins/index.js | 23 +++++++++++++++---- 4 files changed, 31 insertions(+), 8 deletions(-) rename cypress/integration/{user_can_see_posts_count_on_post.js => user_can_see_posts_count_on_post_spec.js} (87%) diff --git a/cypress/integration/user_can_see_posts_count_on_post.js b/cypress/integration/user_can_see_posts_count_on_post_spec.js similarity index 87% rename from cypress/integration/user_can_see_posts_count_on_post.js rename to cypress/integration/user_can_see_posts_count_on_post_spec.js index e2bfc5b0d..a8ca3ccf9 100644 --- a/cypress/integration/user_can_see_posts_count_on_post.js +++ b/cypress/integration/user_can_see_posts_count_on_post_spec.js @@ -1,6 +1,9 @@ describe("Timeline", () => { it("can see likes count on a new post", () => { - // sign up + //clearDB drops the DB for a fresh test environment + cy.task('clearDb'); + + //sign up cy.visit("/users/signup"); cy.get("#email").type("someone@example.com"); cy.get("#password").type("password"); @@ -20,9 +23,9 @@ describe("Timeline", () => { cy.get("#new-post-form").submit(); cy.get(".posts").should("contain", "Hello, world!"); - + // Assert that we can see the likes count cy.get(".posts").should("contain", "0 likes"); + }); - }); - \ No newline at end of file + }); \ No newline at end of file diff --git a/cypress/integration/user_can_sign_in_spec.js b/cypress/integration/user_can_sign_in_spec.js index 7fee902c2..d59e0137a 100644 --- a/cypress/integration/user_can_sign_in_spec.js +++ b/cypress/integration/user_can_sign_in_spec.js @@ -1,5 +1,7 @@ describe("Authentication", () => { it("A user signs in and is redirected to /posts", () => { + //clearDB drops the DB for a fresh test environment + cy.task('clearDb'); // sign up cy.visit("/users/signup"); cy.get("#email").type("someone@example.com"); diff --git a/cypress/integration/user_can_submit_posts_spec.js b/cypress/integration/user_can_submit_posts_spec.js index 1d229c24c..b3dac2c39 100644 --- a/cypress/integration/user_can_submit_posts_spec.js +++ b/cypress/integration/user_can_submit_posts_spec.js @@ -1,5 +1,8 @@ describe("Timeline", () => { it("can submit posts, when signed in, and view them", () => { + //clearDB drops the DB for a fresh test environment + cy.task('clearDb'); + // sign up cy.visit("/users/signup"); cy.get("#email").type("someone@example.com"); diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js index f6b2b82ce..919e10258 100644 --- a/cypress/plugins/index.js +++ b/cypress/plugins/index.js @@ -11,7 +11,22 @@ // This function is called when a project is opened or re-opened (e.g. due to // the project's config changing) -module.exports = function() { - // `on` is used to hook into various events Cypress emits - // `config` is the resolved Cypress config -} +// `on` is used to hook into various events Cypress emits +// `config` is the resolved Cypress config + + +const mongoose = require('mongoose'); + +module.exports = (on) => { + on('task', { + async clearDb() { + await mongoose.connect('mongodb://0.0.0.0/acebook_test'); + + await mongoose.connection.db.dropDatabase(); + + await mongoose.connection.close(); + + return null; + } + }); +}; From be8cc5859da522fa36c3a971807d50abaac8a2db Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 14 Jun 2023 12:24:01 +0100 Subject: [PATCH 08/63] Added authentication logic to dynamically update navbar links --- controllers/sessions.js | 7 ++++- public/images/acebook logo.jpg | Bin 0 -> 58250 bytes public/stylesheets/style.css | 46 ++++++++++++++++++++++++++++++++- views/layout.hbs | 17 +++++++++--- views/sessions/login.hbs | 1 + views/users/signup.hbs | 1 + 6 files changed, 67 insertions(+), 5 deletions(-) create mode 100644 public/images/acebook logo.jpg diff --git a/controllers/sessions.js b/controllers/sessions.js index 1ea5de389..23182805a 100644 --- a/controllers/sessions.js +++ b/controllers/sessions.js @@ -20,11 +20,16 @@ const SessionsController = { res.redirect("/sessions/login"); } else { req.session.user = user; - res.redirect("/posts"); + // Implemented authentication logic to dynamically update navbar links based on the user's login status. + const isAuthenticated = req.session.user ? true : false; + res.render("posts", { isAuthenticated: isAuthenticated }); } }); }, + + + Destroy: (req, res) => { console.log("logging out"); if (req.session.user && req.cookies.user_sid) { diff --git a/public/images/acebook logo.jpg b/public/images/acebook logo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0c1ab491ed4463a3c608e806d20f42cff553b214 GIT binary patch literal 58250 zcmeFYWk8!v(k+G{S^*_qkf>D!-xmr8Pqa)5hxzn^9g`%?g%0h$1LfE3^@KoKAdkOl|@KhE>uF1>GM1ppit z004Lf0KltZ000O0pEA3v`@0^HGX(%>d*9uv0RRA=3IH(P@xL&-#oo#2?`Q7+1a7|r zo>(!An+O)LCf16oHU=;jeuh1w_P;S&%tb8)Xh*8g}z zLPsy<`X!5$j8|7bd1P`)Q_mnVDP?q=fr($+yn5<@QCdb$LFX&%b{6pT@3%%0koo<8 zj^qF4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literal 0 HcmV?d00001 diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css index bccef7208..418a34857 100644 --- a/public/stylesheets/style.css +++ b/public/stylesheets/style.css @@ -1,9 +1,53 @@ body { padding: 50px; font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; - background-color: rgb(238, 208, 170); + background-color: whitesmoke; } a { color: #00B7FF; } + + +nav { + display: flex; + justify-content: space-between; + padding: 5px 5%; + align-items: center; + background-color: #006d77; +} + +ul { + list-style: none; +} + +ul li { + display: inline-block; +} + +ul li a { + text-decoration: none; + color: #ffddd2; + padding: 8px 30px; + border-radius: 7px; + transition: all .3s ease; +} + +ul li a:hover, +ul li a.active { + color: #ffddd2; + background: #83c5be; +} + +/* Signup page */ +#new-user-form{ + padding-top: 5rem; + color: red; +} + + +/* Login age */ +#new-session-form{ + padding-top: 5rem; +} + diff --git a/views/layout.hbs b/views/layout.hbs index 17645b71e..e64bfb121 100644 --- a/views/layout.hbs +++ b/views/layout.hbs @@ -5,9 +5,20 @@ -
- -
+ +{{!-- Authentication for user's login status which is linked to the controller sessions.js file under the Create method --}} +
{{{body}}} diff --git a/views/sessions/login.hbs b/views/sessions/login.hbs index 86de20b62..0ac738258 100644 --- a/views/sessions/login.hbs +++ b/views/sessions/login.hbs @@ -1,3 +1,4 @@ +
diff --git a/views/users/signup.hbs b/views/users/signup.hbs index 13e3b4fc1..fa9b98cfd 100644 --- a/views/users/signup.hbs +++ b/views/users/signup.hbs @@ -1,3 +1,4 @@ + From 8282c16e9dfdb693b21d8c00f2cbc5b5b2fbb972 Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 14 Jun 2023 14:18:58 +0100 Subject: [PATCH 09/63] updated user.js to redirect to login --- controllers/users.js | 4 +++- views/sessions/login.hbs | 1 - views/users/signup.hbs | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/users.js b/controllers/users.js index 1fda78319..7500928c0 100644 --- a/controllers/users.js +++ b/controllers/users.js @@ -13,7 +13,9 @@ const UsersController = { if (err) { throw err; } - res.status(201).redirect("/posts"); + // Updated the code to redirect the user to the login page after successful sign-up. + // This allows the user to log in and ensures that the navbar dynamically adjusts based on the user's login status. + res.status(201).redirect("/sessions/login"); }); }, }; diff --git a/views/sessions/login.hbs b/views/sessions/login.hbs index 0ac738258..86de20b62 100644 --- a/views/sessions/login.hbs +++ b/views/sessions/login.hbs @@ -1,4 +1,3 @@ - diff --git a/views/users/signup.hbs b/views/users/signup.hbs index fa9b98cfd..13e3b4fc1 100644 --- a/views/users/signup.hbs +++ b/views/users/signup.hbs @@ -1,4 +1,3 @@ - From 233cc0067aa5528a39bec588eeb1f3c5fa080219 Mon Sep 17 00:00:00 2001 From: Louis Martin <106453870+Lou-Martin@users.noreply.github.com> Date: Wed, 14 Jun 2023 14:20:28 +0100 Subject: [PATCH 10/63] Delete test_spec.js --- cypress/integration/test_spec.js | 1 - 1 file changed, 1 deletion(-) delete mode 100644 cypress/integration/test_spec.js diff --git a/cypress/integration/test_spec.js b/cypress/integration/test_spec.js deleted file mode 100644 index cfcab9c87..000000000 --- a/cypress/integration/test_spec.js +++ /dev/null @@ -1 +0,0 @@ -//hello testers \ No newline at end of file From 8210f445d2d8356c47396dccf9de584ac77d4ee5 Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 14 Jun 2023 15:26:20 +0100 Subject: [PATCH 11/63] fixed navbar to redirect to post/ not log user out --- controllers/posts.js | 4 ++-- controllers/sessions.js | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/controllers/posts.js b/controllers/posts.js index 4b521304d..c207d06f5 100644 --- a/controllers/posts.js +++ b/controllers/posts.js @@ -6,8 +6,8 @@ const PostsController = { if (err) { throw err; } - - res.render("posts/index", { posts: posts }); + // Implemented authentication logic to dynamically update navbar links based on the user's login status. + res.render("posts/index", { posts: posts, isAuthenticated: true}); }); }, New: (req, res) => { diff --git a/controllers/sessions.js b/controllers/sessions.js index 23182805a..849ad3fec 100644 --- a/controllers/sessions.js +++ b/controllers/sessions.js @@ -20,9 +20,7 @@ const SessionsController = { res.redirect("/sessions/login"); } else { req.session.user = user; - // Implemented authentication logic to dynamically update navbar links based on the user's login status. - const isAuthenticated = req.session.user ? true : false; - res.render("posts", { isAuthenticated: isAuthenticated }); + res.redirect("/posts"); } }); }, From 025d3411e71ff92553781f6d7309238587709efd Mon Sep 17 00:00:00 2001 From: Louis Date: Wed, 14 Jun 2023 15:44:18 +0100 Subject: [PATCH 12/63] change user_can_sign_in_spec.js to not rely on posts to pass --- cypress/integration/user_can_sign_in_spec.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cypress/integration/user_can_sign_in_spec.js b/cypress/integration/user_can_sign_in_spec.js index d59e0137a..c11ca50f0 100644 --- a/cypress/integration/user_can_sign_in_spec.js +++ b/cypress/integration/user_can_sign_in_spec.js @@ -5,16 +5,15 @@ describe("Authentication", () => { // sign up cy.visit("/users/signup"); cy.get("#email").type("someone@example.com"); - cy.get("#password").type("password"); + cy.get("#password").type("mPgaN5s51g!"); cy.get("#submit").click(); // sign in cy.visit("/sessions/login"); cy.get("#email").type("someone@example.com"); - cy.get("#password").type("password"); + cy.get("#password").type("mPgaN5s51g!"); cy.get("#submit").click(); - cy.url().should("include", "/posts"); - cy.contains("a", "New post"); + cy.url().should("not.equal", "/sessions/login"); }); }); From dfb108e72d53cdd0fed1d72665c924da2ec9ac71 Mon Sep 17 00:00:00 2001 From: Barlowi2023 Date: Wed, 14 Jun 2023 15:46:42 +0100 Subject: [PATCH 13/63] authentication added to posts/new --- controllers/posts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/posts.js b/controllers/posts.js index c207d06f5..d0f6b4a3c 100644 --- a/controllers/posts.js +++ b/controllers/posts.js @@ -11,7 +11,7 @@ const PostsController = { }); }, New: (req, res) => { - res.render("posts/new", {}); + res.render("posts/new", {isAuthenticated: true}); }, Create: (req, res) => { const post = new Post(req.body); From 63fd8a35ec87bd52a476238d7511e003f7b73476 Mon Sep 17 00:00:00 2001 From: Louis Date: Wed, 14 Jun 2023 15:46:55 +0100 Subject: [PATCH 14/63] change test name to match spec and code --- .../{user_can_sign_in_spec.js => user_can_log_in_spec.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename cypress/integration/{user_can_sign_in_spec.js => user_can_log_in_spec.js} (100%) diff --git a/cypress/integration/user_can_sign_in_spec.js b/cypress/integration/user_can_log_in_spec.js similarity index 100% rename from cypress/integration/user_can_sign_in_spec.js rename to cypress/integration/user_can_log_in_spec.js From be9cea3c235f5f627157982b60ba7812039a0fb6 Mon Sep 17 00:00:00 2001 From: Louis Date: Wed, 14 Jun 2023 16:09:37 +0100 Subject: [PATCH 15/63] add log in tests --- cypress/integration/user_can_log_in_spec.js | 2 +- ...er_logs_in_with_incorrect_email_address.js | 20 +++++++++++++++++++ .../user_logs_in_with_incorrect_password.js | 20 +++++++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 cypress/integration/user_logs_in_with_incorrect_email_address.js create mode 100644 cypress/integration/user_logs_in_with_incorrect_password.js diff --git a/cypress/integration/user_can_log_in_spec.js b/cypress/integration/user_can_log_in_spec.js index c11ca50f0..131141cd8 100644 --- a/cypress/integration/user_can_log_in_spec.js +++ b/cypress/integration/user_can_log_in_spec.js @@ -1,5 +1,5 @@ describe("Authentication", () => { - it("A user signs in and is redirected to /posts", () => { + it("A user signs in and is redirected on successfully sign in", () => { //clearDB drops the DB for a fresh test environment cy.task('clearDb'); // sign up diff --git a/cypress/integration/user_logs_in_with_incorrect_email_address.js b/cypress/integration/user_logs_in_with_incorrect_email_address.js new file mode 100644 index 000000000..439a58591 --- /dev/null +++ b/cypress/integration/user_logs_in_with_incorrect_email_address.js @@ -0,0 +1,20 @@ +describe("Authentication", () => { + it("A user signs in with an incorrect email address and an error message is displayed", () => { + //clearDB drops the DB for a fresh test environment + cy.task('clearDb'); + // sign up + cy.visit("/users/signup"); + cy.get("#email").type("someone@example.com"); + cy.get("#password").type("mPgaN5s51g!"); + cy.get("#submit").click(); + + // sign in + cy.visit("/sessions/login"); + cy.get("#email").type("howardmoon@example.com"); + cy.get("#password").type("mPgaN5s51g!"); + cy.get("#submit").click(); + + // check for error message, NOTE: this checks the entire page and as such will fail if this text is anywhere on the page. Potential area for refactoring + cy.contains('Invalid email or password'); + }); +}); \ No newline at end of file diff --git a/cypress/integration/user_logs_in_with_incorrect_password.js b/cypress/integration/user_logs_in_with_incorrect_password.js new file mode 100644 index 000000000..5d8bbc7a9 --- /dev/null +++ b/cypress/integration/user_logs_in_with_incorrect_password.js @@ -0,0 +1,20 @@ +describe("Authentication", () => { + it("A user signs in with an incorrect password and an error message is displayed", () => { + //clearDB drops the DB for a fresh test environment + cy.task('clearDb'); + // sign up + cy.visit("/users/signup"); + cy.get("#email").type("someone@example.com"); + cy.get("#password").type("mPgaN5s51g!"); + cy.get("#submit").click(); + + // sign in + cy.visit("/sessions/login"); + cy.get("#email").type("someone@example.com"); + cy.get("#password").type("password"); + cy.get("#submit").click(); + + // check for error message, NOTE: this checks the entire page and as such will fail if this text is anywhere on the page. Potential area for refactoring + cy.contains('Invalid email or password'); + }); +}); \ No newline at end of file From c77d476de75735805461ccf285121d1a4e209e7c Mon Sep 17 00:00:00 2001 From: Louis Date: Wed, 14 Jun 2023 16:23:57 +0100 Subject: [PATCH 16/63] add test for clear button on log in page --- ...ser_clicks_cancel_button_on_log_in_page.js | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 cypress/integration/user_clicks_cancel_button_on_log_in_page.js diff --git a/cypress/integration/user_clicks_cancel_button_on_log_in_page.js b/cypress/integration/user_clicks_cancel_button_on_log_in_page.js new file mode 100644 index 000000000..8bd5ad674 --- /dev/null +++ b/cypress/integration/user_clicks_cancel_button_on_log_in_page.js @@ -0,0 +1,22 @@ +describe("log in functionality", () => { + it("A user clicks the clear button on log in page and the form is cleared", () => { + //clearDB drops the DB for a fresh test environment + cy.task('clearDb'); + // sign up + cy.visit("/users/signup"); + cy.get("#email").type("someone@example.com"); + cy.get("#password").type("mPgaN5s51g!"); + cy.get("#submit").click(); + + // visit the log in page, fill fields and click cancel + cy.visit("/sessions/login"); + cy.get("#email").type("a test string"); + cy.get("#password").type("*"); + cy.get("#clear").click(); + + // check that email and password fields are cleared + + cy.get("#email").should('have.value', ''); + cy.get("#password").should('have.value', ''); + }); +}); \ No newline at end of file From 803c234954451194431556f28ae356e3c1408a80 Mon Sep 17 00:00:00 2001 From: = <=> Date: Wed, 14 Jun 2023 16:26:47 +0100 Subject: [PATCH 17/63] add homepage tests --- .../integration/{home_page_spec.js => 1 home_page_spec.js} | 0 ...user_can_visit_home_page_and_see_sign_up_button_spec.js | 6 ++++++ ...sign_up_button_and_is_navigated_to_sign_up_page.spec.js | 7 +++++++ ...4 user_can_vist_home_page_and_see_log_in_button_spec.js | 6 ++++++ ..._click_log_in_button_and_is_navigated_to_log_in_page.js | 7 +++++++ 5 files changed, 26 insertions(+) rename cypress/integration/{home_page_spec.js => 1 home_page_spec.js} (100%) create mode 100644 cypress/integration/2 user_can_visit_home_page_and_see_sign_up_button_spec.js create mode 100644 cypress/integration/3 from_the_home_page_user_can_click_sign_up_button_and_is_navigated_to_sign_up_page.spec.js create mode 100644 cypress/integration/4 user_can_vist_home_page_and_see_log_in_button_spec.js create mode 100644 cypress/integration/5 from_the_home_page_user_can_click_log_in_button_and_is_navigated_to_log_in_page.js diff --git a/cypress/integration/home_page_spec.js b/cypress/integration/1 home_page_spec.js similarity index 100% rename from cypress/integration/home_page_spec.js rename to cypress/integration/1 home_page_spec.js diff --git a/cypress/integration/2 user_can_visit_home_page_and_see_sign_up_button_spec.js b/cypress/integration/2 user_can_visit_home_page_and_see_sign_up_button_spec.js new file mode 100644 index 000000000..f92d71416 --- /dev/null +++ b/cypress/integration/2 user_can_visit_home_page_and_see_sign_up_button_spec.js @@ -0,0 +1,6 @@ +describe("Home page", () => { + it("has a title", () => { + cy.visit("/"); + cy.get("nav").should("contain", "Sign-up"); + }); +}); diff --git a/cypress/integration/3 from_the_home_page_user_can_click_sign_up_button_and_is_navigated_to_sign_up_page.spec.js b/cypress/integration/3 from_the_home_page_user_can_click_sign_up_button_and_is_navigated_to_sign_up_page.spec.js new file mode 100644 index 000000000..e1736caf8 --- /dev/null +++ b/cypress/integration/3 from_the_home_page_user_can_click_sign_up_button_and_is_navigated_to_sign_up_page.spec.js @@ -0,0 +1,7 @@ +describe("Home page", () => { + it("has a title", () => { + cy.visit("/"); + cy.get("#Sign-up").click(); + cy.get(".title").should("contain", "Sign-up"); + }); +}); diff --git a/cypress/integration/4 user_can_vist_home_page_and_see_log_in_button_spec.js b/cypress/integration/4 user_can_vist_home_page_and_see_log_in_button_spec.js new file mode 100644 index 000000000..9eb6ed33e --- /dev/null +++ b/cypress/integration/4 user_can_vist_home_page_and_see_log_in_button_spec.js @@ -0,0 +1,6 @@ +describe("Home page", () => { + it("has a title", () => { + cy.visit("/"); + cy.get("nav").should("contain", "Log in"); + }); +}); diff --git a/cypress/integration/5 from_the_home_page_user_can_click_log_in_button_and_is_navigated_to_log_in_page.js b/cypress/integration/5 from_the_home_page_user_can_click_log_in_button_and_is_navigated_to_log_in_page.js new file mode 100644 index 000000000..3705d3de8 --- /dev/null +++ b/cypress/integration/5 from_the_home_page_user_can_click_log_in_button_and_is_navigated_to_log_in_page.js @@ -0,0 +1,7 @@ +describe("Home page", () => { + it("has a title", () => { + cy.visit("/"); + cy.get("#Log in").click(); + cy.get(".title").should("contain", "Log in"); + }); +}); From 1a9764648185a1a38adce36d71f2ed5719a36369 Mon Sep 17 00:00:00 2001 From: Phoebe Swaine Date: Wed, 14 Jun 2023 16:28:21 +0100 Subject: [PATCH 18/63] Pushing Test Additions --- .../integration/signup_email_alread_in_use.js | 19 +++++++++++++++++++ ...ord_fails_and_error_message_is_returned.js | 19 +++++++++++++++++++ cypress/integration/signup_password_passes.js | 19 +++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 cypress/integration/signup_email_alread_in_use.js create mode 100644 cypress/integration/signup_password_fails_and_error_message_is_returned.js create mode 100644 cypress/integration/signup_password_passes.js diff --git a/cypress/integration/signup_email_alread_in_use.js b/cypress/integration/signup_email_alread_in_use.js new file mode 100644 index 000000000..cd1c4bd82 --- /dev/null +++ b/cypress/integration/signup_email_alread_in_use.js @@ -0,0 +1,19 @@ +describe('User Sign Up - Already Used Email', () => { + it('should display an error message for an already used email', () => { + const existingEmail = 'someone@example.com'; + const validPassword = 'Thisisaccepabl3'; + + cy.visit('/users/signup'); + + //sign up + cy.get("#email").type(existingEmail); + cy.get("#password").type(validPassword); + cy.get("#submit").click(); + + // Assert that the user stays on the signup page + cy.url().should('include', '/users/signup'); + + // Assert that the error message is displayed + //cy.contains('span.error-message', 'Invalid username or password'); + }); +}); \ No newline at end of file diff --git a/cypress/integration/signup_password_fails_and_error_message_is_returned.js b/cypress/integration/signup_password_fails_and_error_message_is_returned.js new file mode 100644 index 000000000..e5a03a8d8 --- /dev/null +++ b/cypress/integration/signup_password_fails_and_error_message_is_returned.js @@ -0,0 +1,19 @@ +describe('User Sign Up - Password Boundary Value', () => { + it('should display an error message for an invalid password length', () => { + const validEmail = 'someone@example.com'; + const invalidPassword = 'no'; + + cy.visit('/users/signup'); + + //sign up + cy.get("#email").type(validEmail); + cy.get("#password").type(invalidPassword); + cy.get("#submit").click(); + + // Assert that the user stays on the signup page + cy.url().should('include', '/users/signup'); + + // Assert that the error message is displayed + //cy.contains('span.error-message', 'Invalid username or password'); + }); +}); \ No newline at end of file diff --git a/cypress/integration/signup_password_passes.js b/cypress/integration/signup_password_passes.js new file mode 100644 index 000000000..256364bb4 --- /dev/null +++ b/cypress/integration/signup_password_passes.js @@ -0,0 +1,19 @@ +describe('User Sign Up - Password Boundary Value', () => { + it('should display an error message for an invalid password length', () => { + const validEmail = 'tester@example.com'; + const validPassword = 'Thisisaccepabl3'; + + cy.visit('/users/signup'); + + //sign up + cy.get("#email").type(validEmail); + cy.get("#password").type(validPassword); + cy.get("#submit").click(); + + // Assert that the user stays on the signup page + cy.url().should('include', '/sessions/login'); + + // Assert that the error message is displayed + //cy.contains('span.error-message', 'Invalid username or password'); + }); +}); \ No newline at end of file From b73956e6497a1c4229bb8aa52a4f0864f5bd4f6d Mon Sep 17 00:00:00 2001 From: Louis Date: Thu, 15 Jun 2023 10:07:40 +0100 Subject: [PATCH 19/63] add clearDb task --- cypress/integration/user_can_sign_up_spec.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cypress/integration/user_can_sign_up_spec.js b/cypress/integration/user_can_sign_up_spec.js index 771168f55..d4dbf9389 100644 --- a/cypress/integration/user_can_sign_up_spec.js +++ b/cypress/integration/user_can_sign_up_spec.js @@ -1,5 +1,7 @@ describe("Registration", () => { it("A user signs up and is redirected to sign in", () => { + //clearDB drops the DB for a fresh test environment + cy.task('clearDb'); // sign up cy.visit("/users/signup"); cy.get("#email").type("someone@example.com"); From 67d00b256d656162f51c8b878f2d181186abb1bc Mon Sep 17 00:00:00 2001 From: Yousef Hafez Date: Thu, 15 Jun 2023 10:19:05 +0100 Subject: [PATCH 20/63] added profile --- app.js | 6 +++- controllers/userPosts.js | 23 +++++++++++++++ controllers/users.js | 64 ++++++++++++++++++++++++++++++++++++++++ models/user.js | 9 ++++++ routes/userPosts.js | 8 +++++ routes/users.js | 9 +++++- views/users/profile.hbs | 14 +++++++++ 7 files changed, 131 insertions(+), 2 deletions(-) create mode 100644 controllers/userPosts.js create mode 100644 routes/userPosts.js create mode 100644 views/users/profile.hbs diff --git a/app.js b/app.js index 0f4a39b2a..8f1399ed4 100644 --- a/app.js +++ b/app.js @@ -9,7 +9,8 @@ const methodOverride = require("method-override"); const homeRouter = require("./routes/home"); const postsRouter = require("./routes/posts"); const sessionsRouter = require("./routes/sessions"); -const usersRouter = require("./routes/users"); +const usersRouter = require("./routes/users"); +const userPostsRouter = require("./routes/userPosts"); // create a route for users/username @@ -25,6 +26,7 @@ app.use(express.urlencoded({ extended: true })); app.use(cookieParser()); app.use(express.static(path.join(__dirname, "public"))); app.use(methodOverride("_method")); +app.use("/users/:username/posts", userPostsRouter); app.use( session({ @@ -60,6 +62,8 @@ app.use("/", homeRouter); app.use("/posts", sessionChecker, postsRouter); app.use("/sessions", sessionsRouter); app.use("/users", usersRouter); +app.use("/users/:username/posts", userPostsRouter); + // catch 404 and forward to error handler app.use((req, res, next) => { diff --git a/controllers/userPosts.js b/controllers/userPosts.js new file mode 100644 index 000000000..de6b8892b --- /dev/null +++ b/controllers/userPosts.js @@ -0,0 +1,23 @@ +const User = require("../models/user"); + +const UserPostsController = { + Create: (req, res) => { + const username = req.params.username; + const content = req.body.content; + + + User.findOneAndUpdate( { username }, { $push: { posts: { content } } }, { new: true }, + (err) => { + if (err) { + throw err; + } + res.status(201).redirect(`/users/${username}`); + } + ); + }, + }; + + module.exports = UserPostsController; + + + diff --git a/controllers/users.js b/controllers/users.js index 1fda78319..53dc1394a 100644 --- a/controllers/users.js +++ b/controllers/users.js @@ -1,4 +1,6 @@ const User = require("../models/user"); +const Post = require("../models/post"); + const UsersController = { New: (req, res) => { @@ -16,6 +18,68 @@ const UsersController = { res.status(201).redirect("/posts"); }); }, + UserProfile: (req, res) => { + const username = req.params.username; + + User.findOne({ username }, (err, user) => { + if (err) { + throw err; + } + res.render("users/profile", { user }); + }); + }, + + CreatePost: (req, res) => { + const username = req.params.username; + const postContent = req.body.content; + + User.findOne({ username }, (err, user) => { + if (err || !user) { + res.status(404).send("User not found"); + } else { + const post = { + content: postContent, + author: user._id, + }; + user.posts.push(post); + + user.save((err) => { + if (err) { + throw err; + } + res.status(201).redirect(`/users/${username}`); + }); + } + }); + }, + + Show: (req, res) => { + const username = req.params.username; + User.findOne({ username }, (err, user) => { + if (err || !user) { + + res.status(404).send("User not found"); + } else { + + res.render("users/profile", { user }); + } + }); + }, + + EditPost: (req, res) => { + const postId = req.params.postId; + // Fetch the post from the database based on the provided postId + Post.findOne({ _id: postId }, (err, post) => { + if (err || !post) { + res.status(404).send("Post not found"); + } else { + res.render("posts/edit", { post }); + } + }); + }, + }; + + module.exports = UsersController; diff --git a/models/user.js b/models/user.js index deb3f4550..f83e85a83 100644 --- a/models/user.js +++ b/models/user.js @@ -3,6 +3,15 @@ const mongoose = require("mongoose"); const UserSchema = new mongoose.Schema({ email: String, password: String, + posts: [ + { + content: String, + author: { + type: mongoose.Schema.Types.ObjectId, + ref: "User", + }, + }, + ], }); const User = mongoose.model("User", UserSchema); diff --git a/routes/userPosts.js b/routes/userPosts.js new file mode 100644 index 000000000..0918bdbae --- /dev/null +++ b/routes/userPosts.js @@ -0,0 +1,8 @@ +const express = require("express"); +const router = express.Router(); + +const UserPostsController = require("../controllers/userPosts"); + +router.post("/", UserPostsController.Create); + +module.exports = router; \ No newline at end of file diff --git a/routes/users.js b/routes/users.js index 2bb063df8..31484c006 100644 --- a/routes/users.js +++ b/routes/users.js @@ -7,4 +7,11 @@ const UsersController = require("../controllers/users"); router.get("/signup", UsersController.New); router.post("/", UsersController.Create); -module.exports = router; +router.get("/:username", UsersController.UserProfile); +router.post("/:username/posts", UsersController.CreatePost); +router.get("/:username", UsersController.Show); +router.get("/:username/posts/:postId/edit", UsersController.EditPost); + + + +module.exports = router; diff --git a/views/users/profile.hbs b/views/users/profile.hbs new file mode 100644 index 000000000..206c6e962 --- /dev/null +++ b/views/users/profile.hbs @@ -0,0 +1,14 @@ +

Profile Page

+

Username: {{ user.username }}

+

Email: {{ user.email }}

+ +{{!-- add all other profile information needed above--}} + +

Create Post

+ + + + + + +{{!-- mabye can display all current posts made by users under create posts --}} \ No newline at end of file From dd8095af06e911bb6d04c186fe12f052ecb963bc Mon Sep 17 00:00:00 2001 From: Dan Date: Thu, 15 Jun 2023 11:47:22 +0100 Subject: [PATCH 21/63] changes made to connect user details in browser bar/link --- controllers/posts.js | 2 +- controllers/users.js | 2 +- views/layout.hbs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/posts.js b/controllers/posts.js index d0f6b4a3c..8e3dc353b 100644 --- a/controllers/posts.js +++ b/controllers/posts.js @@ -7,7 +7,7 @@ const PostsController = { throw err; } // Implemented authentication logic to dynamically update navbar links based on the user's login status. - res.render("posts/index", { posts: posts, isAuthenticated: true}); + res.render("posts/index", { posts: posts, user: req.session.user, isAuthenticated: true}); }); }, New: (req, res) => { diff --git a/controllers/users.js b/controllers/users.js index 2fab4b5b0..62c4b7258 100644 --- a/controllers/users.js +++ b/controllers/users.js @@ -27,7 +27,7 @@ const UsersController = { if (err) { throw err; } - res.render("users/profile", { user }); + res.render("users/profile", { user, isAuthenticated: true }); }); }, diff --git a/views/layout.hbs b/views/layout.hbs index e64bfb121..be0b6a521 100644 --- a/views/layout.hbs +++ b/views/layout.hbs @@ -11,7 +11,7 @@
    {{#if isAuthenticated}}
  • Posts
  • -
  • Profile
  • +
  • Profile
  • Logout
  • {{else}}
  • Login
  • From 64903a9788c5368fb2b0b00b97720f931c048244 Mon Sep 17 00:00:00 2001 From: Louis Date: Thu, 15 Jun 2023 12:14:28 +0100 Subject: [PATCH 22/63] add all log in and out tests to dedicated folder --- .../user_can_log_in_spec.js | 0 .../log in and out/user_can_log_out_spec.js | 25 ++++++++++++++++ ...g_out_then_navigates_to_posts_page_spec.js | 30 +++++++++++++++++++ ...ser_clicks_cancel_button_on_log_in_page.js | 0 ...er_logs_in_with_incorrect_email_address.js | 0 .../user_logs_in_with_incorrect_password.js | 0 6 files changed, 55 insertions(+) rename cypress/integration/{ => log in and out}/user_can_log_in_spec.js (100%) create mode 100644 cypress/integration/log in and out/user_can_log_out_spec.js create mode 100644 cypress/integration/log in and out/user_can_log_out_then_navigates_to_posts_page_spec.js rename cypress/integration/{ => log in and out}/user_clicks_cancel_button_on_log_in_page.js (100%) rename cypress/integration/{ => log in and out}/user_logs_in_with_incorrect_email_address.js (100%) rename cypress/integration/{ => log in and out}/user_logs_in_with_incorrect_password.js (100%) diff --git a/cypress/integration/user_can_log_in_spec.js b/cypress/integration/log in and out/user_can_log_in_spec.js similarity index 100% rename from cypress/integration/user_can_log_in_spec.js rename to cypress/integration/log in and out/user_can_log_in_spec.js diff --git a/cypress/integration/log in and out/user_can_log_out_spec.js b/cypress/integration/log in and out/user_can_log_out_spec.js new file mode 100644 index 000000000..5ce7d1373 --- /dev/null +++ b/cypress/integration/log in and out/user_can_log_out_spec.js @@ -0,0 +1,25 @@ +describe("Session Handling", () => { + it("A logged in user can log out and is redirected to landing page", () => { + //clearDB drops the DB for a fresh test environment + cy.task('clearDb'); + + // sign up + cy.visit("/users/signup"); + cy.get("#email").type("someone@example.com"); + cy.get("#password").type("mPgaN5s51g!"); + cy.get("#submit").click(); + + // sign in + cy.visit("/sessions/login"); + cy.get("#email").type("someone@example.com"); + cy.get("#password").type("mPgaN5s51g!"); + cy.get("#submit").click(); + + // log out + cy.get('nav > ul > li').contains('Logout').click(); + + // check redirect to log in + cy.url().should('include', '/sessions/login'); + + }); +}); \ No newline at end of file diff --git a/cypress/integration/log in and out/user_can_log_out_then_navigates_to_posts_page_spec.js b/cypress/integration/log in and out/user_can_log_out_then_navigates_to_posts_page_spec.js new file mode 100644 index 000000000..f00b96eac --- /dev/null +++ b/cypress/integration/log in and out/user_can_log_out_then_navigates_to_posts_page_spec.js @@ -0,0 +1,30 @@ +describe("Session Handling", () => { + it("A logged in user can log out and is unable to navigate to posts", () => { + //clearDB drops the DB for a fresh test environment + cy.task('clearDb'); + + // sign up + cy.visit("/users/signup"); + cy.get("#email").type("someone@example.com"); + cy.get("#password").type("mPgaN5s51g!"); + cy.get("#submit").click(); + + // sign in + cy.visit("/sessions/login"); + cy.get("#email").type("someone@example.com"); + cy.get("#password").type("mPgaN5s51g!"); + cy.get("#submit").click(); + + // log out + cy.get('nav > ul > li').contains('Logout').click(); + + // check redirect to log in + cy.url().should('include', '/sessions/login'); + + // atempt to navigate to posts + cy.visit("/posts") + + // check that "new post" isnt visible on the screen + cy.contains('New post').should('not.exist'); + }); +}); \ No newline at end of file diff --git a/cypress/integration/user_clicks_cancel_button_on_log_in_page.js b/cypress/integration/log in and out/user_clicks_cancel_button_on_log_in_page.js similarity index 100% rename from cypress/integration/user_clicks_cancel_button_on_log_in_page.js rename to cypress/integration/log in and out/user_clicks_cancel_button_on_log_in_page.js diff --git a/cypress/integration/user_logs_in_with_incorrect_email_address.js b/cypress/integration/log in and out/user_logs_in_with_incorrect_email_address.js similarity index 100% rename from cypress/integration/user_logs_in_with_incorrect_email_address.js rename to cypress/integration/log in and out/user_logs_in_with_incorrect_email_address.js diff --git a/cypress/integration/user_logs_in_with_incorrect_password.js b/cypress/integration/log in and out/user_logs_in_with_incorrect_password.js similarity index 100% rename from cypress/integration/user_logs_in_with_incorrect_password.js rename to cypress/integration/log in and out/user_logs_in_with_incorrect_password.js From 1dbb1bfb26046e7446df3bdf306ed864bca5bc13 Mon Sep 17 00:00:00 2001 From: Phoebe Swaine Date: Thu, 15 Jun 2023 12:17:50 +0100 Subject: [PATCH 23/63] Pushing Test Additions --- cypress/integration/signup_password_empty.js | 17 +++++++++++ .../signup_password_over_30_characters.js | 28 +++++++++++++++++++ cypress/integration/signup_password_passes.js | 17 ++++++----- 3 files changed, 55 insertions(+), 7 deletions(-) create mode 100644 cypress/integration/signup_password_empty.js create mode 100644 cypress/integration/signup_password_over_30_characters.js diff --git a/cypress/integration/signup_password_empty.js b/cypress/integration/signup_password_empty.js new file mode 100644 index 000000000..a24b7f1d7 --- /dev/null +++ b/cypress/integration/signup_password_empty.js @@ -0,0 +1,17 @@ +describe('User Sign Up - Password Boundary Value', () => { + it('Error message and url check for if password is empty', () => { + const validEmail = 'someone@example.com'; + + cy.visit('/users/signup'); + + //sign up + cy.get("#email").type(validEmail); + cy.get("#submit").click(); + + // Assert that the user stays on the signup page + cy.url().should('include', '/users/signup'); + + // Assert that the error message is displayed + //cy.contains('span.error-message', 'Invalid username or password'); + }); +}); \ No newline at end of file diff --git a/cypress/integration/signup_password_over_30_characters.js b/cypress/integration/signup_password_over_30_characters.js new file mode 100644 index 000000000..d1eb8fb44 --- /dev/null +++ b/cypress/integration/signup_password_over_30_characters.js @@ -0,0 +1,28 @@ +describe('User Sign Up - Password Boundary Value', () => { + it('should test a variety of passwords on and over the character boundary', () => { + const validEmail = 'tester@example.com'; + + cy.visit('/users/signup'); + + // Password on the boundary of 30 characters + cy.get("#email").type(validEmail); + cy.get("#password").type('123456789012345678901234567890'); + cy.get("#submit").click(); + cy.url().should('include', '/sessions/login'); + + // Password under the boundary of 30 characters + cy.visit('/users/signup'); + cy.get("#email").type(validEmail); + cy.get("#password").type('12345678901234567890123456789'); + cy.get("#submit").click(); + cy.url().should('include', '/sessions/login'); + + // Password over the boundary of 30 characters + cy.visit('/users/signup'); + cy.get("#email").type(validEmail); + cy.get("#password").type('1234567890123456789012345678901'); + cy.get("#submit").click(); + cy.url().should('include', '/users/signup'); + // cy.contains('span.error-message', 'Too many characters'); + }); +}); \ No newline at end of file diff --git a/cypress/integration/signup_password_passes.js b/cypress/integration/signup_password_passes.js index 256364bb4..c32c7ec93 100644 --- a/cypress/integration/signup_password_passes.js +++ b/cypress/integration/signup_password_passes.js @@ -1,19 +1,22 @@ describe('User Sign Up - Password Boundary Value', () => { - it('should display an error message for an invalid password length', () => { + it('should test a variety of passwords on and over the character boundry', () => { const validEmail = 'tester@example.com'; - const validPassword = 'Thisisaccepabl3'; + const validPassword = 'hi345678'; + const alsovalidPassword = 'hi23456789'; cy.visit('/users/signup'); - //sign up + //sign up - 8 characters cy.get("#email").type(validEmail); cy.get("#password").type(validPassword); cy.get("#submit").click(); - - // Assert that the user stays on the signup page cy.url().should('include', '/sessions/login'); - // Assert that the error message is displayed - //cy.contains('span.error-message', 'Invalid username or password'); + //sign up - 9 characters + cy.visit('/users/signup'); + cy.get("#email").type(validEmail); + cy.get("#password").type(alsovalidPassword); + cy.get("#submit").click(); + cy.url().should('include', '/sessions/login'); }); }); \ No newline at end of file From 16e799d2d88e76a5c5ed90de898d2f1f8ddcf6de Mon Sep 17 00:00:00 2001 From: Louis Date: Thu, 15 Jun 2023 12:19:26 +0100 Subject: [PATCH 24/63] change folder to remove whitespace --- .../{log in and out => login_and_out}/user_can_log_in_spec.js | 0 .../{log in and out => login_and_out}/user_can_log_out_spec.js | 0 .../user_can_log_out_then_navigates_to_posts_page_spec.js | 0 .../user_clicks_cancel_button_on_log_in_page.js | 0 .../user_logs_in_with_incorrect_email_address.js | 0 .../user_logs_in_with_incorrect_password.js | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename cypress/integration/{log in and out => login_and_out}/user_can_log_in_spec.js (100%) rename cypress/integration/{log in and out => login_and_out}/user_can_log_out_spec.js (100%) rename cypress/integration/{log in and out => login_and_out}/user_can_log_out_then_navigates_to_posts_page_spec.js (100%) rename cypress/integration/{log in and out => login_and_out}/user_clicks_cancel_button_on_log_in_page.js (100%) rename cypress/integration/{log in and out => login_and_out}/user_logs_in_with_incorrect_email_address.js (100%) rename cypress/integration/{log in and out => login_and_out}/user_logs_in_with_incorrect_password.js (100%) diff --git a/cypress/integration/log in and out/user_can_log_in_spec.js b/cypress/integration/login_and_out/user_can_log_in_spec.js similarity index 100% rename from cypress/integration/log in and out/user_can_log_in_spec.js rename to cypress/integration/login_and_out/user_can_log_in_spec.js diff --git a/cypress/integration/log in and out/user_can_log_out_spec.js b/cypress/integration/login_and_out/user_can_log_out_spec.js similarity index 100% rename from cypress/integration/log in and out/user_can_log_out_spec.js rename to cypress/integration/login_and_out/user_can_log_out_spec.js diff --git a/cypress/integration/log in and out/user_can_log_out_then_navigates_to_posts_page_spec.js b/cypress/integration/login_and_out/user_can_log_out_then_navigates_to_posts_page_spec.js similarity index 100% rename from cypress/integration/log in and out/user_can_log_out_then_navigates_to_posts_page_spec.js rename to cypress/integration/login_and_out/user_can_log_out_then_navigates_to_posts_page_spec.js diff --git a/cypress/integration/log in and out/user_clicks_cancel_button_on_log_in_page.js b/cypress/integration/login_and_out/user_clicks_cancel_button_on_log_in_page.js similarity index 100% rename from cypress/integration/log in and out/user_clicks_cancel_button_on_log_in_page.js rename to cypress/integration/login_and_out/user_clicks_cancel_button_on_log_in_page.js diff --git a/cypress/integration/log in and out/user_logs_in_with_incorrect_email_address.js b/cypress/integration/login_and_out/user_logs_in_with_incorrect_email_address.js similarity index 100% rename from cypress/integration/log in and out/user_logs_in_with_incorrect_email_address.js rename to cypress/integration/login_and_out/user_logs_in_with_incorrect_email_address.js diff --git a/cypress/integration/log in and out/user_logs_in_with_incorrect_password.js b/cypress/integration/login_and_out/user_logs_in_with_incorrect_password.js similarity index 100% rename from cypress/integration/log in and out/user_logs_in_with_incorrect_password.js rename to cypress/integration/login_and_out/user_logs_in_with_incorrect_password.js From 73074a7c019a53fa73ea53c2f5057d042704d664 Mon Sep 17 00:00:00 2001 From: = <=> Date: Thu, 15 Jun 2023 12:20:49 +0100 Subject: [PATCH 25/63] added remaining posts test --- ...ec.js => 17 user_can_submit_posts_spec.js} | 0 ..._can_see_zero_likes_count_on_post_spec.js} | 0 ...user_tries_to _submit_a blank_post_spec.js | 30 +++++++++++++++++++ ...ries_to _submit_an_inoji_in_a_post_spec.js | 27 +++++++++++++++++ ...s_to _submit_a_hyperlink_in_a_post_spec.js | 27 +++++++++++++++++ ...ts_post_username_is_displayed_with_post.js | 27 +++++++++++++++++ ...st_date_and_time_is_displayed_with_post.js | 29 ++++++++++++++++++ ...st_home_page_and_see_log_in_button_spec.js | 2 +- 8 files changed, 141 insertions(+), 1 deletion(-) rename cypress/integration/{user_can_submit_posts_spec.js => 17 user_can_submit_posts_spec.js} (100%) rename cypress/integration/{user_can_see_posts_count_on_post_spec.js => 18 user_can_see_zero_likes_count_on_post_spec.js} (100%) create mode 100644 cypress/integration/22 user_tries_to _submit_a blank_post_spec.js create mode 100644 cypress/integration/23 user_tries_to _submit_an_inoji_in_a_post_spec.js create mode 100644 cypress/integration/24 user_tries_to _submit_a_hyperlink_in_a_post_spec.js create mode 100644 cypress/integration/31 when_user_submits_post_username_is_displayed_with_post.js create mode 100644 cypress/integration/32 when_user_submits_post_date_and_time_is_displayed_with_post.js diff --git a/cypress/integration/user_can_submit_posts_spec.js b/cypress/integration/17 user_can_submit_posts_spec.js similarity index 100% rename from cypress/integration/user_can_submit_posts_spec.js rename to cypress/integration/17 user_can_submit_posts_spec.js diff --git a/cypress/integration/user_can_see_posts_count_on_post_spec.js b/cypress/integration/18 user_can_see_zero_likes_count_on_post_spec.js similarity index 100% rename from cypress/integration/user_can_see_posts_count_on_post_spec.js rename to cypress/integration/18 user_can_see_zero_likes_count_on_post_spec.js diff --git a/cypress/integration/22 user_tries_to _submit_a blank_post_spec.js b/cypress/integration/22 user_tries_to _submit_a blank_post_spec.js new file mode 100644 index 000000000..75b849ec5 --- /dev/null +++ b/cypress/integration/22 user_tries_to _submit_a blank_post_spec.js @@ -0,0 +1,30 @@ +describe("Timeline", () => { + it("can submit posts, when signed in, and view them", () => { + //clearDB drops the DB for a fresh test environment + cy.task('clearDb'); + + // sign up + cy.visit("/users/signup"); + cy.get("#email").type("someone@example.com"); + cy.get("#password").type("password"); + cy.get("#submit").click(); + + // sign in + cy.visit("/sessions/login"); + cy.get("#email").type("someone@example.com"); + cy.get("#password").type("password"); + cy.get("#submit").click(); + + // submit a post + cy.visit("/posts"); + cy.contains("New post").click(); + + //cy.get("#new-post-form").find('[type="text"]').type(""); + cy.get("#new-post-form").submit(); + // check for error message, NOTE: this checks the entire page and as such will fail if this text is anywhere on the page. Potential area for refactoring + //cy.contains('post must be populated'); + // tempory test to assert still on new post page + cy.url().should('include', '/posts/new'); + + }); +}); diff --git a/cypress/integration/23 user_tries_to _submit_an_inoji_in_a_post_spec.js b/cypress/integration/23 user_tries_to _submit_an_inoji_in_a_post_spec.js new file mode 100644 index 000000000..3e440d04a --- /dev/null +++ b/cypress/integration/23 user_tries_to _submit_an_inoji_in_a_post_spec.js @@ -0,0 +1,27 @@ +describe("Timeline", () => { + it("can submit posts, when signed in, and view them", () => { + //clearDB drops the DB for a fresh test environment + cy.task('clearDb'); + + // sign up + cy.visit("/users/signup"); + cy.get("#email").type("someone@example.com"); + cy.get("#password").type("password"); + cy.get("#submit").click(); + + // sign in + cy.visit("/sessions/login"); + cy.get("#email").type("someone@example.com"); + cy.get("#password").type("password"); + cy.get("#submit").click(); + + // submit a post + cy.visit("/posts"); + cy.contains("New post").click(); + + cy.get("#new-post-form").find('[type="text"]').type("😊"); + cy.get("#new-post-form").submit(); + cy.url().should('include', 'posts'); + + }); +}); diff --git a/cypress/integration/24 user_tries_to _submit_a_hyperlink_in_a_post_spec.js b/cypress/integration/24 user_tries_to _submit_a_hyperlink_in_a_post_spec.js new file mode 100644 index 000000000..a3502a783 --- /dev/null +++ b/cypress/integration/24 user_tries_to _submit_a_hyperlink_in_a_post_spec.js @@ -0,0 +1,27 @@ +describe("Timeline", () => { + it("can submit posts, when signed in, and view them", () => { + //clearDB drops the DB for a fresh test environment + cy.task('clearDb'); + + // sign up + cy.visit("/users/signup"); + cy.get("#email").type("someone@example.com"); + cy.get("#password").type("password"); + cy.get("#submit").click(); + + // sign in + cy.visit("/sessions/login"); + cy.get("#email").type("someone@example.com"); + cy.get("#password").type("password"); + cy.get("#submit").click(); + + // submit a post + cy.visit("/posts"); + cy.contains("New post").click(); + + cy.get("#new-post-form").find('[type="text"]').type("https://www.diy.com"); + cy.get("#new-post-form").submit(); + cy.url().should('include', 'posts'); + + }); +}); diff --git a/cypress/integration/31 when_user_submits_post_username_is_displayed_with_post.js b/cypress/integration/31 when_user_submits_post_username_is_displayed_with_post.js new file mode 100644 index 000000000..dc8563a32 --- /dev/null +++ b/cypress/integration/31 when_user_submits_post_username_is_displayed_with_post.js @@ -0,0 +1,27 @@ +describe("Timeline", () => { + it("can submit posts, when signed in, and view them", () => { + //clearDB drops the DB for a fresh test environment + cy.task('clearDb'); + + // sign up + cy.visit("/users/signup"); + cy.get("#email").type("someone@example.com"); + cy.get("#password").type("password"); + cy.get("#submit").click(); + + // sign in + cy.visit("/sessions/login"); + cy.get("#email").type("someone@example.com"); + cy.get("#password").type("password"); + cy.get("#submit").click(); + + // submit a post + cy.visit("/posts"); + cy.contains("New post").click(); + + cy.get("#new-post-form").find('[type="text"]').type("test"); + cy.get("#new-post-form").submit(); + // check for error message, NOTE: this checks the entire page and as such will fail if this text is anywhere on the page. Potential area for refactoring + cy.contains('username'); + }); +}); diff --git a/cypress/integration/32 when_user_submits_post_date_and_time_is_displayed_with_post.js b/cypress/integration/32 when_user_submits_post_date_and_time_is_displayed_with_post.js new file mode 100644 index 000000000..8fc41226b --- /dev/null +++ b/cypress/integration/32 when_user_submits_post_date_and_time_is_displayed_with_post.js @@ -0,0 +1,29 @@ +describe("Timeline", () => { + it("can submit posts, when signed in, and view them", () => { + //clearDB drops the DB for a fresh test environment + cy.task('clearDb'); + + // sign up + cy.visit("/users/signup"); + cy.get("#email").type("someone@example.com"); + cy.get("#password").type("password"); + cy.get("#submit").click(); + + // sign in + cy.visit("/sessions/login"); + cy.get("#email").type("someone@example.com"); + cy.get("#password").type("password"); + cy.get("#submit").click(); + + // submit a post + cy.visit("/posts"); + cy.contains("New post").click(); + + cy.get("#new-post-form").find('[type="text"]').type("test"); + const now = new Date(); + const currentDate = now.getDate() + '/' + (now.getMonth()+1) + '/' + now.getFullYear() + '-' + now.getHours() + ':' + now.getMinutes(); + cy.get("#new-post-form").submit(); + // check for error message, NOTE: this checks the entire page and as such will fail if this text is anywhere on the page. Potential area for refactoring + cy.contains(currentDate); + }); +}); diff --git a/cypress/integration/4 user_can_vist_home_page_and_see_log_in_button_spec.js b/cypress/integration/4 user_can_vist_home_page_and_see_log_in_button_spec.js index 9eb6ed33e..b717a1fb3 100644 --- a/cypress/integration/4 user_can_vist_home_page_and_see_log_in_button_spec.js +++ b/cypress/integration/4 user_can_vist_home_page_and_see_log_in_button_spec.js @@ -1,6 +1,6 @@ describe("Home page", () => { it("has a title", () => { cy.visit("/"); - cy.get("nav").should("contain", "Log in"); + cy.get("nav").should("contain", "Login"); }); }); From 8a3c31176945a7a0fec4212ba835372e9851a74e Mon Sep 17 00:00:00 2001 From: = <=> Date: Thu, 15 Jun 2023 14:30:25 +0100 Subject: [PATCH 26/63] add two timeline tests --- ...eir_own_post_and_see_like_count_increat.js | 28 +++++++++++++++++++ ...ies_to _submit_an_imoji_in_a_post_spec.js} | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 cypress/integration/19 after_creating_post_user_can_like_their_own_post_and_see_like_count_increat.js rename cypress/integration/{23 user_tries_to _submit_an_inoji_in_a_post_spec.js => 23 user_tries_to _submit_an_imoji_in_a_post_spec.js} (93%) diff --git a/cypress/integration/19 after_creating_post_user_can_like_their_own_post_and_see_like_count_increat.js b/cypress/integration/19 after_creating_post_user_can_like_their_own_post_and_see_like_count_increat.js new file mode 100644 index 000000000..56a7887c4 --- /dev/null +++ b/cypress/integration/19 after_creating_post_user_can_like_their_own_post_and_see_like_count_increat.js @@ -0,0 +1,28 @@ +describe("Timeline", () => { + it("can submit posts, when signed in, and view them", () => { + //clearDB drops the DB for a fresh test environment + cy.task('clearDb'); + + // sign up + cy.visit("/users/signup"); + cy.get("#email").type("someone@example.com"); + cy.get("#password").type("password"); + cy.get("#submit").click(); + + // sign in + cy.visit("/sessions/login"); + cy.get("#email").type("someone@example.com"); + cy.get("#password").type("password"); + cy.get("#submit").click(); + + // submit a post + cy.visit("/posts"); + cy.contains("New post").click(); + + cy.get("#new-post-form").find('[type="text"]').type("self like test"); + cy.get("#new-post-form").submit(); + cy.click() + cy.get(".posts").should("contain", "1 like"); + + }); +}); diff --git a/cypress/integration/23 user_tries_to _submit_an_inoji_in_a_post_spec.js b/cypress/integration/23 user_tries_to _submit_an_imoji_in_a_post_spec.js similarity index 93% rename from cypress/integration/23 user_tries_to _submit_an_inoji_in_a_post_spec.js rename to cypress/integration/23 user_tries_to _submit_an_imoji_in_a_post_spec.js index 3e440d04a..251c0fa2c 100644 --- a/cypress/integration/23 user_tries_to _submit_an_inoji_in_a_post_spec.js +++ b/cypress/integration/23 user_tries_to _submit_an_imoji_in_a_post_spec.js @@ -21,7 +21,7 @@ describe("Timeline", () => { cy.get("#new-post-form").find('[type="text"]').type("😊"); cy.get("#new-post-form").submit(); - cy.url().should('include', 'posts'); + cy.get(".posts").should("contain", "😊"); }); }); From 924c854de306f8034d673c954dc5077167ef7720 Mon Sep 17 00:00:00 2001 From: Barlowi2023 Date: Thu, 15 Jun 2023 14:53:26 +0100 Subject: [PATCH 27/63] added username to user.js in models and index.hbs --- models/user.js | 5 +++-- views/layout.hbs | 2 +- views/posts/index.hbs | 9 ++++++--- views/users/signup.hbs | 4 ++++ 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/models/user.js b/models/user.js index f83e85a83..169ad3efc 100644 --- a/models/user.js +++ b/models/user.js @@ -1,8 +1,9 @@ const mongoose = require("mongoose"); const UserSchema = new mongoose.Schema({ - email: String, - password: String, + username: {type: String, required: true}, + email: { type: String, required: true }, + password: { type: String, required: true }, posts: [ { content: String, diff --git a/views/layout.hbs b/views/layout.hbs index be0b6a521..8483d1dcc 100644 --- a/views/layout.hbs +++ b/views/layout.hbs @@ -11,7 +11,7 @@
      {{#if isAuthenticated}}
    • Posts
    • -
    • Profile
    • +
    • Profile
    • Logout
    • {{else}}
    • Login
    • diff --git a/views/posts/index.hbs b/views/posts/index.hbs index 4a4bca1d8..f1b980d85 100644 --- a/views/posts/index.hbs +++ b/views/posts/index.hbs @@ -1,8 +1,11 @@

      Timeline

      -
        +
          +
        • {{{this.username}}}
        • {{#each posts}} -
        • {{this.message}}
        • -
        • {{this.likes}} likes
        • +
        • {{{this.message}}}
        • +
          +
        • {{{this.likes}}} likes
        • +
          {{/each}}
        diff --git a/views/users/signup.hbs b/views/users/signup.hbs index 13e3b4fc1..638efa08f 100644 --- a/views/users/signup.hbs +++ b/views/users/signup.hbs @@ -1,7 +1,11 @@
        + +
        + + From 0d39a85cbc169d268a104298d655cf48f6010f74 Mon Sep 17 00:00:00 2001 From: Louis Date: Thu, 15 Jun 2023 15:49:48 +0100 Subject: [PATCH 28/63] add entry point tests --- ..._navigates_directly_to_post_submission_page.js | 15 +++++++++++++++ .../user_navigates_directly_to_posts_page.js | 15 +++++++++++++++ ...=> user_clicks_clear_button_on_log_in_page.js} | 0 3 files changed, 30 insertions(+) create mode 100644 cypress/integration/entry_point/user_navigates_directly_to_post_submission_page.js create mode 100644 cypress/integration/entry_point/user_navigates_directly_to_posts_page.js rename cypress/integration/login_and_out/{user_clicks_cancel_button_on_log_in_page.js => user_clicks_clear_button_on_log_in_page.js} (100%) diff --git a/cypress/integration/entry_point/user_navigates_directly_to_post_submission_page.js b/cypress/integration/entry_point/user_navigates_directly_to_post_submission_page.js new file mode 100644 index 000000000..bf9cfd2ce --- /dev/null +++ b/cypress/integration/entry_point/user_navigates_directly_to_post_submission_page.js @@ -0,0 +1,15 @@ +describe("Authentication", () => { + it("A user attempts to navigate to new post and is redirected to sign in", () => { + //clearDB drops the DB for a fresh test environment + cy.task('clearDb'); + + // go directly to new posts, do not sign up, do not pass go, do not collect £200 + cy.visit("/posts/new"); + + // check that "new-post-form" isnt visible on the screen + cy.get("#new-post-form").should('not.exist'); + + // check the redirect + cy.url().should("contain", "/sessions/login"); + }); +}); \ No newline at end of file diff --git a/cypress/integration/entry_point/user_navigates_directly_to_posts_page.js b/cypress/integration/entry_point/user_navigates_directly_to_posts_page.js new file mode 100644 index 000000000..abd710925 --- /dev/null +++ b/cypress/integration/entry_point/user_navigates_directly_to_posts_page.js @@ -0,0 +1,15 @@ +describe("Authentication", () => { + it("A user attempts to navigate to posts and is redirected to sign in", () => { + //clearDB drops the DB for a fresh test environment + cy.task('clearDb'); + + // go directly to posts, do not sign up, do not pass go, do not collect £200 + cy.visit("/posts"); + + // check that "new post" isnt visible on the screen + cy.contains('New post').should('not.exist'); + + // check the redirect + cy.url().should("contain", "/sessions/login"); + }); +}); \ No newline at end of file diff --git a/cypress/integration/login_and_out/user_clicks_cancel_button_on_log_in_page.js b/cypress/integration/login_and_out/user_clicks_clear_button_on_log_in_page.js similarity index 100% rename from cypress/integration/login_and_out/user_clicks_cancel_button_on_log_in_page.js rename to cypress/integration/login_and_out/user_clicks_clear_button_on_log_in_page.js From 33e3fce0eb1fa93022642e9ee57bc8453ae88d5f Mon Sep 17 00:00:00 2001 From: Louis Date: Thu, 15 Jun 2023 15:53:13 +0100 Subject: [PATCH 29/63] add filing system for tests --- cypress/integration/{ => homepage}/1 home_page_spec.js | 0 .../2 user_can_visit_home_page_and_see_sign_up_button_spec.js | 0 ..._click_sign_up_button_and_is_navigated_to_sign_up_page.spec.js | 0 .../4 user_can_vist_home_page_and_see_log_in_button_spec.js | 0 ...ser_can_click_log_in_button_and_is_navigated_to_log_in_page.js | 0 cypress/integration/{ => posts}/17 user_can_submit_posts_spec.js | 0 .../{ => posts}/18 user_can_see_zero_likes_count_on_post_spec.js | 0 ...ost_user_can_like_their_own_post_and_see_like_count_increat.js | 0 .../{ => posts}/22 user_tries_to _submit_a blank_post_spec.js | 0 .../23 user_tries_to _submit_an_imoji_in_a_post_spec.js | 0 .../24 user_tries_to _submit_a_hyperlink_in_a_post_spec.js | 0 .../31 when_user_submits_post_username_is_displayed_with_post.js | 0 ...when_user_submits_post_date_and_time_is_displayed_with_post.js | 0 cypress/integration/{ => sign_up}/signup_email_alread_in_use.js | 0 cypress/integration/{ => sign_up}/signup_password_empty.js | 0 .../signup_password_fails_and_error_message_is_returned.js | 0 .../{ => sign_up}/signup_password_over_30_characters.js | 0 cypress/integration/{ => sign_up}/signup_password_passes.js | 0 cypress/integration/{ => sign_up}/user_can_sign_up_spec.js | 0 19 files changed, 0 insertions(+), 0 deletions(-) rename cypress/integration/{ => homepage}/1 home_page_spec.js (100%) rename cypress/integration/{ => homepage}/2 user_can_visit_home_page_and_see_sign_up_button_spec.js (100%) rename cypress/integration/{ => homepage}/3 from_the_home_page_user_can_click_sign_up_button_and_is_navigated_to_sign_up_page.spec.js (100%) rename cypress/integration/{ => homepage}/4 user_can_vist_home_page_and_see_log_in_button_spec.js (100%) rename cypress/integration/{ => homepage}/5 from_the_home_page_user_can_click_log_in_button_and_is_navigated_to_log_in_page.js (100%) rename cypress/integration/{ => posts}/17 user_can_submit_posts_spec.js (100%) rename cypress/integration/{ => posts}/18 user_can_see_zero_likes_count_on_post_spec.js (100%) rename cypress/integration/{ => posts}/19 after_creating_post_user_can_like_their_own_post_and_see_like_count_increat.js (100%) rename cypress/integration/{ => posts}/22 user_tries_to _submit_a blank_post_spec.js (100%) rename cypress/integration/{ => posts}/23 user_tries_to _submit_an_imoji_in_a_post_spec.js (100%) rename cypress/integration/{ => posts}/24 user_tries_to _submit_a_hyperlink_in_a_post_spec.js (100%) rename cypress/integration/{ => posts}/31 when_user_submits_post_username_is_displayed_with_post.js (100%) rename cypress/integration/{ => posts}/32 when_user_submits_post_date_and_time_is_displayed_with_post.js (100%) rename cypress/integration/{ => sign_up}/signup_email_alread_in_use.js (100%) rename cypress/integration/{ => sign_up}/signup_password_empty.js (100%) rename cypress/integration/{ => sign_up}/signup_password_fails_and_error_message_is_returned.js (100%) rename cypress/integration/{ => sign_up}/signup_password_over_30_characters.js (100%) rename cypress/integration/{ => sign_up}/signup_password_passes.js (100%) rename cypress/integration/{ => sign_up}/user_can_sign_up_spec.js (100%) diff --git a/cypress/integration/1 home_page_spec.js b/cypress/integration/homepage/1 home_page_spec.js similarity index 100% rename from cypress/integration/1 home_page_spec.js rename to cypress/integration/homepage/1 home_page_spec.js diff --git a/cypress/integration/2 user_can_visit_home_page_and_see_sign_up_button_spec.js b/cypress/integration/homepage/2 user_can_visit_home_page_and_see_sign_up_button_spec.js similarity index 100% rename from cypress/integration/2 user_can_visit_home_page_and_see_sign_up_button_spec.js rename to cypress/integration/homepage/2 user_can_visit_home_page_and_see_sign_up_button_spec.js diff --git a/cypress/integration/3 from_the_home_page_user_can_click_sign_up_button_and_is_navigated_to_sign_up_page.spec.js b/cypress/integration/homepage/3 from_the_home_page_user_can_click_sign_up_button_and_is_navigated_to_sign_up_page.spec.js similarity index 100% rename from cypress/integration/3 from_the_home_page_user_can_click_sign_up_button_and_is_navigated_to_sign_up_page.spec.js rename to cypress/integration/homepage/3 from_the_home_page_user_can_click_sign_up_button_and_is_navigated_to_sign_up_page.spec.js diff --git a/cypress/integration/4 user_can_vist_home_page_and_see_log_in_button_spec.js b/cypress/integration/homepage/4 user_can_vist_home_page_and_see_log_in_button_spec.js similarity index 100% rename from cypress/integration/4 user_can_vist_home_page_and_see_log_in_button_spec.js rename to cypress/integration/homepage/4 user_can_vist_home_page_and_see_log_in_button_spec.js diff --git a/cypress/integration/5 from_the_home_page_user_can_click_log_in_button_and_is_navigated_to_log_in_page.js b/cypress/integration/homepage/5 from_the_home_page_user_can_click_log_in_button_and_is_navigated_to_log_in_page.js similarity index 100% rename from cypress/integration/5 from_the_home_page_user_can_click_log_in_button_and_is_navigated_to_log_in_page.js rename to cypress/integration/homepage/5 from_the_home_page_user_can_click_log_in_button_and_is_navigated_to_log_in_page.js diff --git a/cypress/integration/17 user_can_submit_posts_spec.js b/cypress/integration/posts/17 user_can_submit_posts_spec.js similarity index 100% rename from cypress/integration/17 user_can_submit_posts_spec.js rename to cypress/integration/posts/17 user_can_submit_posts_spec.js diff --git a/cypress/integration/18 user_can_see_zero_likes_count_on_post_spec.js b/cypress/integration/posts/18 user_can_see_zero_likes_count_on_post_spec.js similarity index 100% rename from cypress/integration/18 user_can_see_zero_likes_count_on_post_spec.js rename to cypress/integration/posts/18 user_can_see_zero_likes_count_on_post_spec.js diff --git a/cypress/integration/19 after_creating_post_user_can_like_their_own_post_and_see_like_count_increat.js b/cypress/integration/posts/19 after_creating_post_user_can_like_their_own_post_and_see_like_count_increat.js similarity index 100% rename from cypress/integration/19 after_creating_post_user_can_like_their_own_post_and_see_like_count_increat.js rename to cypress/integration/posts/19 after_creating_post_user_can_like_their_own_post_and_see_like_count_increat.js diff --git a/cypress/integration/22 user_tries_to _submit_a blank_post_spec.js b/cypress/integration/posts/22 user_tries_to _submit_a blank_post_spec.js similarity index 100% rename from cypress/integration/22 user_tries_to _submit_a blank_post_spec.js rename to cypress/integration/posts/22 user_tries_to _submit_a blank_post_spec.js diff --git a/cypress/integration/23 user_tries_to _submit_an_imoji_in_a_post_spec.js b/cypress/integration/posts/23 user_tries_to _submit_an_imoji_in_a_post_spec.js similarity index 100% rename from cypress/integration/23 user_tries_to _submit_an_imoji_in_a_post_spec.js rename to cypress/integration/posts/23 user_tries_to _submit_an_imoji_in_a_post_spec.js diff --git a/cypress/integration/24 user_tries_to _submit_a_hyperlink_in_a_post_spec.js b/cypress/integration/posts/24 user_tries_to _submit_a_hyperlink_in_a_post_spec.js similarity index 100% rename from cypress/integration/24 user_tries_to _submit_a_hyperlink_in_a_post_spec.js rename to cypress/integration/posts/24 user_tries_to _submit_a_hyperlink_in_a_post_spec.js diff --git a/cypress/integration/31 when_user_submits_post_username_is_displayed_with_post.js b/cypress/integration/posts/31 when_user_submits_post_username_is_displayed_with_post.js similarity index 100% rename from cypress/integration/31 when_user_submits_post_username_is_displayed_with_post.js rename to cypress/integration/posts/31 when_user_submits_post_username_is_displayed_with_post.js diff --git a/cypress/integration/32 when_user_submits_post_date_and_time_is_displayed_with_post.js b/cypress/integration/posts/32 when_user_submits_post_date_and_time_is_displayed_with_post.js similarity index 100% rename from cypress/integration/32 when_user_submits_post_date_and_time_is_displayed_with_post.js rename to cypress/integration/posts/32 when_user_submits_post_date_and_time_is_displayed_with_post.js diff --git a/cypress/integration/signup_email_alread_in_use.js b/cypress/integration/sign_up/signup_email_alread_in_use.js similarity index 100% rename from cypress/integration/signup_email_alread_in_use.js rename to cypress/integration/sign_up/signup_email_alread_in_use.js diff --git a/cypress/integration/signup_password_empty.js b/cypress/integration/sign_up/signup_password_empty.js similarity index 100% rename from cypress/integration/signup_password_empty.js rename to cypress/integration/sign_up/signup_password_empty.js diff --git a/cypress/integration/signup_password_fails_and_error_message_is_returned.js b/cypress/integration/sign_up/signup_password_fails_and_error_message_is_returned.js similarity index 100% rename from cypress/integration/signup_password_fails_and_error_message_is_returned.js rename to cypress/integration/sign_up/signup_password_fails_and_error_message_is_returned.js diff --git a/cypress/integration/signup_password_over_30_characters.js b/cypress/integration/sign_up/signup_password_over_30_characters.js similarity index 100% rename from cypress/integration/signup_password_over_30_characters.js rename to cypress/integration/sign_up/signup_password_over_30_characters.js diff --git a/cypress/integration/signup_password_passes.js b/cypress/integration/sign_up/signup_password_passes.js similarity index 100% rename from cypress/integration/signup_password_passes.js rename to cypress/integration/sign_up/signup_password_passes.js diff --git a/cypress/integration/user_can_sign_up_spec.js b/cypress/integration/sign_up/user_can_sign_up_spec.js similarity index 100% rename from cypress/integration/user_can_sign_up_spec.js rename to cypress/integration/sign_up/user_can_sign_up_spec.js From 013c181dcf002c041453ecf1e7a7ed7acd7705b4 Mon Sep 17 00:00:00 2001 From: = <=> Date: Thu, 15 Jun 2023 17:03:13 +0100 Subject: [PATCH 30/63] final posts tests added --- ...eir_own_post_and_see_like_count_increat.js | 4 +- ..._users_post_and_see_like_count_increase.js | 42 ++++++++++++++++ ..._see_posts_displayed_in_date_time_order.js | 50 +++++++++++++++++++ 3 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 cypress/integration/20 User_can_like_another_users_post_and_see_like_count_increase.js create mode 100644 cypress/integration/21 user_can_see_posts_displayed_in_date_time_order.js diff --git a/cypress/integration/19 after_creating_post_user_can_like_their_own_post_and_see_like_count_increat.js b/cypress/integration/19 after_creating_post_user_can_like_their_own_post_and_see_like_count_increat.js index 56a7887c4..612e58816 100644 --- a/cypress/integration/19 after_creating_post_user_can_like_their_own_post_and_see_like_count_increat.js +++ b/cypress/integration/19 after_creating_post_user_can_like_their_own_post_and_see_like_count_increat.js @@ -21,7 +21,9 @@ describe("Timeline", () => { cy.get("#new-post-form").find('[type="text"]').type("self like test"); cy.get("#new-post-form").submit(); - cy.click() + + //clikc like + cy.get("#like").click(); cy.get(".posts").should("contain", "1 like"); }); diff --git a/cypress/integration/20 User_can_like_another_users_post_and_see_like_count_increase.js b/cypress/integration/20 User_can_like_another_users_post_and_see_like_count_increase.js new file mode 100644 index 000000000..a7bdfdc27 --- /dev/null +++ b/cypress/integration/20 User_can_like_another_users_post_and_see_like_count_increase.js @@ -0,0 +1,42 @@ +describe("Timeline", () => { + it("can submit posts, when signed in, and view them", () => { + //clearDB drops the DB for a fresh test environment + cy.task('clearDb'); + + // sign up + cy.visit("/users/signup"); + cy.get("#email").type("someone@example.com"); + cy.get("#password").type("password"); + cy.get("#submit").click(); + + // sign in + cy.visit("/sessions/login"); + cy.get("#email").type("someone@example.com"); + cy.get("#password").type("password"); + cy.get("#submit").click(); + + // submit a post + cy.visit("/posts"); + cy.contains("New post").click(); + + cy.get("#new-post-form").find('[type="text"]').type("other user like test"); + cy.get("#new-post-form").submit(); + + // sign up + cy.visit("/users/signup"); + cy.get("#email").type("someoneelse@example.com"); + cy.get("#password").type("password2"); + cy.get("#submit").click(); + + // sign in + cy.visit("/sessions/login"); + cy.get("#email").type("someoneelse@example.com"); + cy.get("#password").type("password2"); + cy.get("#submit").click(); + + // click like + cy.get("#like").click(); + cy.get(".posts").should("contain", "1 like"); + + }); +}); diff --git a/cypress/integration/21 user_can_see_posts_displayed_in_date_time_order.js b/cypress/integration/21 user_can_see_posts_displayed_in_date_time_order.js new file mode 100644 index 000000000..ee294be95 --- /dev/null +++ b/cypress/integration/21 user_can_see_posts_displayed_in_date_time_order.js @@ -0,0 +1,50 @@ +describe("Timeline", () => { + it("can submit posts, when signed in, and view them", () => { + //clearDB drops the DB for a fresh test environment + cy.task('clearDb'); + + // sign up + cy.visit("/users/signup"); + cy.get("#email").type("someone@example.com"); + cy.get("#password").type("password"); + cy.get("#submit").click(); + + // sign in + cy.visit("/sessions/login"); + cy.get("#email").type("someone@example.com"); + cy.get("#password").type("password"); + cy.get("#submit").click(); + + // submit a post + cy.visit("/posts"); + cy.contains("New post").click(); + + cy.get("#new-post-form").find('[type="text"]').type("1"); + cy.get("#new-post-form").submit(); + // submit a post + cy.visit("/posts"); + cy.contains("New post").click(); + + cy.get("#new-post-form").find('[type="text"]').type("2"); + cy.get("#new-post-form").submit(); + // submit a post + cy.visit("/posts"); + cy.contains("New post").click(); + + cy.get("#new-post-form").find('[type="text"]').type("3"); + cy.get("#new-post-form").submit(); + // submit a post + cy.visit("/posts"); + cy.contains("New post").click(); + + cy.get("#new-post-form").find('[type="text"]').type("4"); + cy.get("#new-post-form").submit(); + + + cy.get(".posts[1]").should("contain", "4"); + cy.get(".posts[2]").should("contain", "3"); + cy.get(".posts[3]").should("contain", "2"); + cy.get(".posts[4]").should("contain", "1"); + + }); +}); From b8ee9c75f4d8b080702f97bba6c43049ad859bc0 Mon Sep 17 00:00:00 2001 From: Dan Date: Thu, 15 Jun 2023 17:10:59 +0100 Subject: [PATCH 31/63] added username and date/time to show in /posts --- controllers/posts.js | 15 ++++++++++++++- models/post.js | 4 +++- views/posts/index.hbs | 7 +++++-- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/controllers/posts.js b/controllers/posts.js index 8e3dc353b..2a385ad9f 100644 --- a/controllers/posts.js +++ b/controllers/posts.js @@ -14,7 +14,19 @@ const PostsController = { res.render("posts/new", {isAuthenticated: true}); }, Create: (req, res) => { - const post = new Post(req.body); + const { message, likes } = req.body; + const username = req.session.user.username; + const now = new Date(); + const options = { + weekday: 'short', + month: 'short', + day: 'numeric', + year: 'numeric', + hour: 'numeric', + minute: 'numeric' + }; + const currentDate = now.toLocaleString('en-US', options); + const post = new Post({ username, message, likes, currentDate }); post.save((err) => { if (err) { throw err; @@ -25,4 +37,5 @@ const PostsController = { }, }; + module.exports = PostsController; diff --git a/models/post.js b/models/post.js index 3ef06ae2d..4ce8fb70c 100644 --- a/models/post.js +++ b/models/post.js @@ -1,8 +1,10 @@ const mongoose = require("mongoose"); const PostSchema = new mongoose.Schema({ + username: String, message: String, - likes: { type: Number, default: 0 } + likes: { type: Number, default: 0 }, + currentDate: { type: String } }); const Post = mongoose.model("Post", PostSchema); diff --git a/views/posts/index.hbs b/views/posts/index.hbs index f1b980d85..eda0327de 100644 --- a/views/posts/index.hbs +++ b/views/posts/index.hbs @@ -1,9 +1,12 @@

        Timeline

          -
        • {{{this.username}}}
        • {{#each posts}} -
        • {{{this.message}}}
        • +
        • Created at: {{this.currentDate}}
        • +
          +
        • {{{this.username}}}

        • +
        • {{{this.message}}}
        • +
        • {{{this.likes}}} likes

        • {{/each}} From 7df0cb3c460aa6e086b84802abccfba05065b7b4 Mon Sep 17 00:00:00 2001 From: Louis Date: Thu, 15 Jun 2023 17:22:55 +0100 Subject: [PATCH 32/63] file organization --- ...ser_can_like_another_users_post_and_see_like_count_increase.js | 0 .../21 user_can_see_posts_displayed_in_date_time_order.js | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename cypress/integration/{ => posts}/20 User_can_like_another_users_post_and_see_like_count_increase.js (100%) rename cypress/integration/{ => posts}/21 user_can_see_posts_displayed_in_date_time_order.js (100%) diff --git a/cypress/integration/20 User_can_like_another_users_post_and_see_like_count_increase.js b/cypress/integration/posts/20 User_can_like_another_users_post_and_see_like_count_increase.js similarity index 100% rename from cypress/integration/20 User_can_like_another_users_post_and_see_like_count_increase.js rename to cypress/integration/posts/20 User_can_like_another_users_post_and_see_like_count_increase.js diff --git a/cypress/integration/21 user_can_see_posts_displayed_in_date_time_order.js b/cypress/integration/posts/21 user_can_see_posts_displayed_in_date_time_order.js similarity index 100% rename from cypress/integration/21 user_can_see_posts_displayed_in_date_time_order.js rename to cypress/integration/posts/21 user_can_see_posts_displayed_in_date_time_order.js From 007a9b49c1685277861fa1437aa918d2d2e102a8 Mon Sep 17 00:00:00 2001 From: = <=> Date: Fri, 16 Jun 2023 09:59:05 +0100 Subject: [PATCH 33/63] Upadted Homepage and Posts tests --- .../posts/17 user_can_submit_posts_spec.js | 1 + .../18 user_can_see_zero_likes_count_on_post_spec.js | 1 + ..._like_their_own_post_and_see_like_count_increat.js | 1 + ..._another_users_post_and_see_like_count_increase.js | 2 ++ ...user_can_see_posts_displayed_in_date_time_order.js | 1 + .../22 user_tries_to _submit_a blank_post_spec.js | 1 + ...3 user_tries_to _submit_an_imoji_in_a_post_spec.js | 1 + ...ser_tries_to _submit_a_hyperlink_in_a_post_spec.js | 1 + ...er_submits_post_username_is_displayed_with_post.js | 3 ++- ...bmits_post_date_and_time_is_displayed_with_post.js | 11 ++++++++++- 10 files changed, 21 insertions(+), 2 deletions(-) diff --git a/cypress/integration/posts/17 user_can_submit_posts_spec.js b/cypress/integration/posts/17 user_can_submit_posts_spec.js index b3dac2c39..708f5ab13 100644 --- a/cypress/integration/posts/17 user_can_submit_posts_spec.js +++ b/cypress/integration/posts/17 user_can_submit_posts_spec.js @@ -5,6 +5,7 @@ describe("Timeline", () => { // sign up cy.visit("/users/signup"); + cy.get("#username").type("User1"); cy.get("#email").type("someone@example.com"); cy.get("#password").type("password"); cy.get("#submit").click(); diff --git a/cypress/integration/posts/18 user_can_see_zero_likes_count_on_post_spec.js b/cypress/integration/posts/18 user_can_see_zero_likes_count_on_post_spec.js index a8ca3ccf9..6879e4189 100644 --- a/cypress/integration/posts/18 user_can_see_zero_likes_count_on_post_spec.js +++ b/cypress/integration/posts/18 user_can_see_zero_likes_count_on_post_spec.js @@ -5,6 +5,7 @@ describe("Timeline", () => { //sign up cy.visit("/users/signup"); + cy.get("#username").type("User1"); cy.get("#email").type("someone@example.com"); cy.get("#password").type("password"); cy.get("#submit").click(); diff --git a/cypress/integration/posts/19 after_creating_post_user_can_like_their_own_post_and_see_like_count_increat.js b/cypress/integration/posts/19 after_creating_post_user_can_like_their_own_post_and_see_like_count_increat.js index 612e58816..2db17301e 100644 --- a/cypress/integration/posts/19 after_creating_post_user_can_like_their_own_post_and_see_like_count_increat.js +++ b/cypress/integration/posts/19 after_creating_post_user_can_like_their_own_post_and_see_like_count_increat.js @@ -5,6 +5,7 @@ describe("Timeline", () => { // sign up cy.visit("/users/signup"); + cy.get("#username").type("User1"); cy.get("#email").type("someone@example.com"); cy.get("#password").type("password"); cy.get("#submit").click(); diff --git a/cypress/integration/posts/20 User_can_like_another_users_post_and_see_like_count_increase.js b/cypress/integration/posts/20 User_can_like_another_users_post_and_see_like_count_increase.js index a7bdfdc27..b9ec37399 100644 --- a/cypress/integration/posts/20 User_can_like_another_users_post_and_see_like_count_increase.js +++ b/cypress/integration/posts/20 User_can_like_another_users_post_and_see_like_count_increase.js @@ -5,6 +5,7 @@ describe("Timeline", () => { // sign up cy.visit("/users/signup"); + cy.get("#username").type("User1"); cy.get("#email").type("someone@example.com"); cy.get("#password").type("password"); cy.get("#submit").click(); @@ -24,6 +25,7 @@ describe("Timeline", () => { // sign up cy.visit("/users/signup"); + cy.get("#username").type("User2"); cy.get("#email").type("someoneelse@example.com"); cy.get("#password").type("password2"); cy.get("#submit").click(); diff --git a/cypress/integration/posts/21 user_can_see_posts_displayed_in_date_time_order.js b/cypress/integration/posts/21 user_can_see_posts_displayed_in_date_time_order.js index ee294be95..e29464a8d 100644 --- a/cypress/integration/posts/21 user_can_see_posts_displayed_in_date_time_order.js +++ b/cypress/integration/posts/21 user_can_see_posts_displayed_in_date_time_order.js @@ -5,6 +5,7 @@ describe("Timeline", () => { // sign up cy.visit("/users/signup"); + cy.get("#username").type("User1"); cy.get("#email").type("someone@example.com"); cy.get("#password").type("password"); cy.get("#submit").click(); diff --git a/cypress/integration/posts/22 user_tries_to _submit_a blank_post_spec.js b/cypress/integration/posts/22 user_tries_to _submit_a blank_post_spec.js index 75b849ec5..e4779b60a 100644 --- a/cypress/integration/posts/22 user_tries_to _submit_a blank_post_spec.js +++ b/cypress/integration/posts/22 user_tries_to _submit_a blank_post_spec.js @@ -5,6 +5,7 @@ describe("Timeline", () => { // sign up cy.visit("/users/signup"); + cy.get("#username").type("User1"); cy.get("#email").type("someone@example.com"); cy.get("#password").type("password"); cy.get("#submit").click(); diff --git a/cypress/integration/posts/23 user_tries_to _submit_an_imoji_in_a_post_spec.js b/cypress/integration/posts/23 user_tries_to _submit_an_imoji_in_a_post_spec.js index 251c0fa2c..db9cfeb3d 100644 --- a/cypress/integration/posts/23 user_tries_to _submit_an_imoji_in_a_post_spec.js +++ b/cypress/integration/posts/23 user_tries_to _submit_an_imoji_in_a_post_spec.js @@ -5,6 +5,7 @@ describe("Timeline", () => { // sign up cy.visit("/users/signup"); + cy.get("#username").type("User1"); cy.get("#email").type("someone@example.com"); cy.get("#password").type("password"); cy.get("#submit").click(); diff --git a/cypress/integration/posts/24 user_tries_to _submit_a_hyperlink_in_a_post_spec.js b/cypress/integration/posts/24 user_tries_to _submit_a_hyperlink_in_a_post_spec.js index a3502a783..69b227545 100644 --- a/cypress/integration/posts/24 user_tries_to _submit_a_hyperlink_in_a_post_spec.js +++ b/cypress/integration/posts/24 user_tries_to _submit_a_hyperlink_in_a_post_spec.js @@ -5,6 +5,7 @@ describe("Timeline", () => { // sign up cy.visit("/users/signup"); + cy.get("#username").type("User1"); cy.get("#email").type("someone@example.com"); cy.get("#password").type("password"); cy.get("#submit").click(); diff --git a/cypress/integration/posts/31 when_user_submits_post_username_is_displayed_with_post.js b/cypress/integration/posts/31 when_user_submits_post_username_is_displayed_with_post.js index dc8563a32..d3dafc429 100644 --- a/cypress/integration/posts/31 when_user_submits_post_username_is_displayed_with_post.js +++ b/cypress/integration/posts/31 when_user_submits_post_username_is_displayed_with_post.js @@ -5,6 +5,7 @@ describe("Timeline", () => { // sign up cy.visit("/users/signup"); + cy.get("#username").type("User1"); cy.get("#email").type("someone@example.com"); cy.get("#password").type("password"); cy.get("#submit").click(); @@ -22,6 +23,6 @@ describe("Timeline", () => { cy.get("#new-post-form").find('[type="text"]').type("test"); cy.get("#new-post-form").submit(); // check for error message, NOTE: this checks the entire page and as such will fail if this text is anywhere on the page. Potential area for refactoring - cy.contains('username'); + cy.contains('User1'); }); }); diff --git a/cypress/integration/posts/32 when_user_submits_post_date_and_time_is_displayed_with_post.js b/cypress/integration/posts/32 when_user_submits_post_date_and_time_is_displayed_with_post.js index 8fc41226b..2f4885190 100644 --- a/cypress/integration/posts/32 when_user_submits_post_date_and_time_is_displayed_with_post.js +++ b/cypress/integration/posts/32 when_user_submits_post_date_and_time_is_displayed_with_post.js @@ -5,6 +5,7 @@ describe("Timeline", () => { // sign up cy.visit("/users/signup"); + cy.get("#username").type("User1"); cy.get("#email").type("someone@example.com"); cy.get("#password").type("password"); cy.get("#submit").click(); @@ -21,7 +22,15 @@ describe("Timeline", () => { cy.get("#new-post-form").find('[type="text"]').type("test"); const now = new Date(); - const currentDate = now.getDate() + '/' + (now.getMonth()+1) + '/' + now.getFullYear() + '-' + now.getHours() + ':' + now.getMinutes(); + const options = { + weekday: 'short', + month: 'short', + day: 'numeric', + year: 'numeric', + hour: 'numeric', + minute: 'numeric' + }; + const currentDate = now.toLocaleString('en-US', options); cy.get("#new-post-form").submit(); // check for error message, NOTE: this checks the entire page and as such will fail if this text is anywhere on the page. Potential area for refactoring cy.contains(currentDate); From 178b80ae6ec95b896c84ee67185bcd1da4c997ff Mon Sep 17 00:00:00 2001 From: Louis Date: Fri, 16 Jun 2023 10:10:00 +0100 Subject: [PATCH 34/63] add scripts to run all sub directories with npm command --- package.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index b0b63690e..1901a784d 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,12 @@ "start:test": "PORT=3030 MONGODB_URL='mongodb://0.0.0.0/acebook_test' npm start", "test": "npm run lint && npm run test:unit && npm run test:integration", "test:unit": "jest", - "test:integration": "cypress run" + "test:integration": "cypress run", + "test:homepage": "cypress run --spec 'cypress/integration/homepage/*'", + "test:login_and_out": "cypress run --spec 'cypress/integration/login_and_out/*'", + "test:posts": "cypress run --spec 'cypress/integration/posts/*'", + "test:sign_up": "cypress run --spec 'cypress/integration/sign_up/*'", + "test:entry_point": "cypress run --spec 'cypress/integration/entry_point/*'" }, "engines": { "node": ">=18.1.0" From 99e4bddd87edb16e11204432d6396cfa25198a7f Mon Sep 17 00:00:00 2001 From: Louis Date: Fri, 16 Jun 2023 10:14:58 +0100 Subject: [PATCH 35/63] add username to all log in/out tests --- cypress/integration/login_and_out/user_can_log_in_spec.js | 1 + cypress/integration/login_and_out/user_can_log_out_spec.js | 1 + .../user_can_log_out_then_navigates_to_posts_page_spec.js | 1 + .../login_and_out/user_clicks_clear_button_on_log_in_page.js | 1 + .../login_and_out/user_logs_in_with_incorrect_email_address.js | 1 + .../login_and_out/user_logs_in_with_incorrect_password.js | 1 + 6 files changed, 6 insertions(+) diff --git a/cypress/integration/login_and_out/user_can_log_in_spec.js b/cypress/integration/login_and_out/user_can_log_in_spec.js index 131141cd8..734af4c26 100644 --- a/cypress/integration/login_and_out/user_can_log_in_spec.js +++ b/cypress/integration/login_and_out/user_can_log_in_spec.js @@ -4,6 +4,7 @@ describe("Authentication", () => { cy.task('clearDb'); // sign up cy.visit("/users/signup"); + cy.get("#username").type("User1"); cy.get("#email").type("someone@example.com"); cy.get("#password").type("mPgaN5s51g!"); cy.get("#submit").click(); diff --git a/cypress/integration/login_and_out/user_can_log_out_spec.js b/cypress/integration/login_and_out/user_can_log_out_spec.js index 5ce7d1373..cdaf7132b 100644 --- a/cypress/integration/login_and_out/user_can_log_out_spec.js +++ b/cypress/integration/login_and_out/user_can_log_out_spec.js @@ -5,6 +5,7 @@ describe("Session Handling", () => { // sign up cy.visit("/users/signup"); + cy.get("#username").type("User1"); cy.get("#email").type("someone@example.com"); cy.get("#password").type("mPgaN5s51g!"); cy.get("#submit").click(); diff --git a/cypress/integration/login_and_out/user_can_log_out_then_navigates_to_posts_page_spec.js b/cypress/integration/login_and_out/user_can_log_out_then_navigates_to_posts_page_spec.js index f00b96eac..c48dcbc26 100644 --- a/cypress/integration/login_and_out/user_can_log_out_then_navigates_to_posts_page_spec.js +++ b/cypress/integration/login_and_out/user_can_log_out_then_navigates_to_posts_page_spec.js @@ -5,6 +5,7 @@ describe("Session Handling", () => { // sign up cy.visit("/users/signup"); + cy.get("#username").type("User1"); cy.get("#email").type("someone@example.com"); cy.get("#password").type("mPgaN5s51g!"); cy.get("#submit").click(); diff --git a/cypress/integration/login_and_out/user_clicks_clear_button_on_log_in_page.js b/cypress/integration/login_and_out/user_clicks_clear_button_on_log_in_page.js index 8bd5ad674..3eb547289 100644 --- a/cypress/integration/login_and_out/user_clicks_clear_button_on_log_in_page.js +++ b/cypress/integration/login_and_out/user_clicks_clear_button_on_log_in_page.js @@ -4,6 +4,7 @@ describe("log in functionality", () => { cy.task('clearDb'); // sign up cy.visit("/users/signup"); + cy.get("#username").type("User1"); cy.get("#email").type("someone@example.com"); cy.get("#password").type("mPgaN5s51g!"); cy.get("#submit").click(); diff --git a/cypress/integration/login_and_out/user_logs_in_with_incorrect_email_address.js b/cypress/integration/login_and_out/user_logs_in_with_incorrect_email_address.js index 439a58591..4d5df1608 100644 --- a/cypress/integration/login_and_out/user_logs_in_with_incorrect_email_address.js +++ b/cypress/integration/login_and_out/user_logs_in_with_incorrect_email_address.js @@ -4,6 +4,7 @@ describe("Authentication", () => { cy.task('clearDb'); // sign up cy.visit("/users/signup"); + cy.get("#username").type("User1"); cy.get("#email").type("someone@example.com"); cy.get("#password").type("mPgaN5s51g!"); cy.get("#submit").click(); diff --git a/cypress/integration/login_and_out/user_logs_in_with_incorrect_password.js b/cypress/integration/login_and_out/user_logs_in_with_incorrect_password.js index 5d8bbc7a9..e2c811f7f 100644 --- a/cypress/integration/login_and_out/user_logs_in_with_incorrect_password.js +++ b/cypress/integration/login_and_out/user_logs_in_with_incorrect_password.js @@ -4,6 +4,7 @@ describe("Authentication", () => { cy.task('clearDb'); // sign up cy.visit("/users/signup"); + cy.get("#username").type("User1"); cy.get("#email").type("someone@example.com"); cy.get("#password").type("mPgaN5s51g!"); cy.get("#submit").click(); From bf972d6cdbcfb25ed9182edb2df298e9eca8e1c3 Mon Sep 17 00:00:00 2001 From: Phoebe Swaine Date: Fri, 16 Jun 2023 12:05:11 +0100 Subject: [PATCH 36/63] Pushing Test Additions --- .../sign_up/signup_email_alread_in_use.js | 2 ++ ...> signup_password_around_30_characters.js} | 5 ++++ .../sign_up/signup_password_empty.js | 28 ++++++++++--------- ...ord_fails_and_error_message_is_returned.js | 2 ++ .../sign_up/signup_password_passes.js | 3 ++ .../sign_up/user_can_sign_up_spec.js | 1 + 6 files changed, 28 insertions(+), 13 deletions(-) rename cypress/integration/sign_up/{signup_password_over_30_characters.js => signup_password_around_30_characters.js} (87%) diff --git a/cypress/integration/sign_up/signup_email_alread_in_use.js b/cypress/integration/sign_up/signup_email_alread_in_use.js index cd1c4bd82..4968fe172 100644 --- a/cypress/integration/sign_up/signup_email_alread_in_use.js +++ b/cypress/integration/sign_up/signup_email_alread_in_use.js @@ -1,11 +1,13 @@ describe('User Sign Up - Already Used Email', () => { it('should display an error message for an already used email', () => { + const username = 'someone1' const existingEmail = 'someone@example.com'; const validPassword = 'Thisisaccepabl3'; cy.visit('/users/signup'); //sign up + cy.get("#username").type(username); cy.get("#email").type(existingEmail); cy.get("#password").type(validPassword); cy.get("#submit").click(); diff --git a/cypress/integration/sign_up/signup_password_over_30_characters.js b/cypress/integration/sign_up/signup_password_around_30_characters.js similarity index 87% rename from cypress/integration/sign_up/signup_password_over_30_characters.js rename to cypress/integration/sign_up/signup_password_around_30_characters.js index d1eb8fb44..60c70d152 100644 --- a/cypress/integration/sign_up/signup_password_over_30_characters.js +++ b/cypress/integration/sign_up/signup_password_around_30_characters.js @@ -1,10 +1,13 @@ describe('User Sign Up - Password Boundary Value', () => { it('should test a variety of passwords on and over the character boundary', () => { + const username = 'Tester1' const validEmail = 'tester@example.com'; cy.visit('/users/signup'); // Password on the boundary of 30 characters + cy.get("#username").type(username); + cy.get("#email").type(validEmail); cy.get("#password").type('123456789012345678901234567890'); cy.get("#submit").click(); @@ -12,6 +15,7 @@ describe('User Sign Up - Password Boundary Value', () => { // Password under the boundary of 30 characters cy.visit('/users/signup'); + cy.get("#username").type(username); cy.get("#email").type(validEmail); cy.get("#password").type('12345678901234567890123456789'); cy.get("#submit").click(); @@ -19,6 +23,7 @@ describe('User Sign Up - Password Boundary Value', () => { // Password over the boundary of 30 characters cy.visit('/users/signup'); + cy.get("#username").type(username); cy.get("#email").type(validEmail); cy.get("#password").type('1234567890123456789012345678901'); cy.get("#submit").click(); diff --git a/cypress/integration/sign_up/signup_password_empty.js b/cypress/integration/sign_up/signup_password_empty.js index a24b7f1d7..affe47bbf 100644 --- a/cypress/integration/sign_up/signup_password_empty.js +++ b/cypress/integration/sign_up/signup_password_empty.js @@ -1,17 +1,19 @@ -describe('User Sign Up - Password Boundary Value', () => { - it('Error message and url check for if password is empty', () => { - const validEmail = 'someone@example.com'; +// describe('User Sign Up - Password Boundary Value', () => { +// it('Error message and url check for if password is empty', () => { +// const username = 'Tester1' +// const validEmail = 'someone@example.com'; - cy.visit('/users/signup'); +// cy.visit('/users/signup'); - //sign up - cy.get("#email").type(validEmail); - cy.get("#submit").click(); +// //sign up +// cy.get("#username").type(username); +// cy.get("#email").type(validEmail); +// cy.get("#submit").click(); - // Assert that the user stays on the signup page - cy.url().should('include', '/users/signup'); +// // Assert that the user stays on the signup page +// cy.url().should('include', '/users/signup'); - // Assert that the error message is displayed - //cy.contains('span.error-message', 'Invalid username or password'); - }); -}); \ No newline at end of file +// // Assert that the error message is displayed +// //cy.contains('span.error-message', 'Invalid username or password'); +// }); +// }); \ No newline at end of file diff --git a/cypress/integration/sign_up/signup_password_fails_and_error_message_is_returned.js b/cypress/integration/sign_up/signup_password_fails_and_error_message_is_returned.js index e5a03a8d8..a70dbd75e 100644 --- a/cypress/integration/sign_up/signup_password_fails_and_error_message_is_returned.js +++ b/cypress/integration/sign_up/signup_password_fails_and_error_message_is_returned.js @@ -1,11 +1,13 @@ describe('User Sign Up - Password Boundary Value', () => { it('should display an error message for an invalid password length', () => { + const username = 'Tester1' const validEmail = 'someone@example.com'; const invalidPassword = 'no'; cy.visit('/users/signup'); //sign up + cy.get("#username").type(username); cy.get("#email").type(validEmail); cy.get("#password").type(invalidPassword); cy.get("#submit").click(); diff --git a/cypress/integration/sign_up/signup_password_passes.js b/cypress/integration/sign_up/signup_password_passes.js index c32c7ec93..90529de41 100644 --- a/cypress/integration/sign_up/signup_password_passes.js +++ b/cypress/integration/sign_up/signup_password_passes.js @@ -1,5 +1,6 @@ describe('User Sign Up - Password Boundary Value', () => { it('should test a variety of passwords on and over the character boundry', () => { + const username = 'Tester1' const validEmail = 'tester@example.com'; const validPassword = 'hi345678'; const alsovalidPassword = 'hi23456789'; @@ -7,6 +8,7 @@ describe('User Sign Up - Password Boundary Value', () => { cy.visit('/users/signup'); //sign up - 8 characters + cy.get("#username").type(username); cy.get("#email").type(validEmail); cy.get("#password").type(validPassword); cy.get("#submit").click(); @@ -14,6 +16,7 @@ describe('User Sign Up - Password Boundary Value', () => { //sign up - 9 characters cy.visit('/users/signup'); + cy.get("#username").type(username); cy.get("#email").type(validEmail); cy.get("#password").type(alsovalidPassword); cy.get("#submit").click(); diff --git a/cypress/integration/sign_up/user_can_sign_up_spec.js b/cypress/integration/sign_up/user_can_sign_up_spec.js index d4dbf9389..0ab93ffcc 100644 --- a/cypress/integration/sign_up/user_can_sign_up_spec.js +++ b/cypress/integration/sign_up/user_can_sign_up_spec.js @@ -4,6 +4,7 @@ describe("Registration", () => { cy.task('clearDb'); // sign up cy.visit("/users/signup"); + cy.get("#username").type('Tester1'); cy.get("#email").type("someone@example.com"); cy.get("#password").type("password"); cy.get("#submit").click(); From 236d26187cc960b1191e89484d539a8d1051adda Mon Sep 17 00:00:00 2001 From: = <=> Date: Fri, 16 Jun 2023 12:28:30 +0100 Subject: [PATCH 37/63] Added post from profile test --- .../34 user_creates_post_from_profile_page.js | 29 ++ localhost_2023-06-16_11-35-54.report.html | 282 ++++++++++++++++++ package-lock.json | 211 +++++++++++++ package.json | 1 + 4 files changed, 523 insertions(+) create mode 100644 cypress/integration/posts/34 user_creates_post_from_profile_page.js create mode 100644 localhost_2023-06-16_11-35-54.report.html diff --git a/cypress/integration/posts/34 user_creates_post_from_profile_page.js b/cypress/integration/posts/34 user_creates_post_from_profile_page.js new file mode 100644 index 000000000..f52c5ca66 --- /dev/null +++ b/cypress/integration/posts/34 user_creates_post_from_profile_page.js @@ -0,0 +1,29 @@ +describe("Timeline", () => { + it("can submit posts, when signed in, and view them", () => { + //clearDB drops the DB for a fresh test environment + cy.task('clearDb'); + + // sign up + cy.visit("/users/signup"); + cy.get("#username").type("User1"); + cy.get("#email").type("someone@example.com"); + cy.get("#password").type("password"); + cy.get("#submit").click(); + + // sign in + cy.visit("/sessions/login"); + cy.get("#email").type("someone@example.com"); + cy.get("#password").type("password"); + cy.get("#submit").click(); + + // submit a post + cy.visit("/posts"); + cy.visit("/users/user1"); + //cy.get("#content").click(); + cy.get('textarea[name="content"]').type("Profile Post Test"); + //cy.get("#textarea").type("Profile Post Test"); + cy.get('button[type="submit"]').click() + + cy.get(".posts").should("contain", "Hello, world!"); + }); +}); diff --git a/localhost_2023-06-16_11-35-54.report.html b/localhost_2023-06-16_11-35-54.report.html new file mode 100644 index 000000000..a197f933b --- /dev/null +++ b/localhost_2023-06-16_11-35-54.report.html @@ -0,0 +1,282 @@ + + + + + + + + Lighthouse Report + + + + + +
          + + + + + + diff --git a/package-lock.json b/package-lock.json index 27002c86c..dfc9a77fc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,6 +23,7 @@ }, "devDependencies": { "cypress": "^9.5.1", + "cypress-failed-log": "^2.10.0", "eslint": "^8.10.0", "eslint-plugin-cypress": "^2.8.1", "eslint-plugin-jest": "^22.21.0", @@ -2562,6 +2563,42 @@ "node": ">=12.0.0" } }, + "node_modules/cypress-failed-log": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/cypress-failed-log/-/cypress-failed-log-2.10.0.tgz", + "integrity": "sha512-v+GsOcpCAgj335zfDy9jDnaujH31SM/6pEQBp0dH0clbYu4NSXirLRXW9WoKhd0j70UrAA0hTLNbS2oTt1Y5kA==", + "dev": true, + "dependencies": { + "debug": "4.3.4", + "logdown": "3.3.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/cypress-failed-log/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/cypress-failed-log/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, "node_modules/cypress/node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -5569,6 +5606,86 @@ "node": ">=8" } }, + "node_modules/logdown": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/logdown/-/logdown-3.3.1.tgz", + "integrity": "sha512-pjX0vlIJsYQlgVzFba2amXI1wZZnhrEorL68MdLI7B0/sN1TNUozBNFaHfcPHMM3A+INZ0OXFDxtnoaEgOmGjQ==", + "dev": true, + "dependencies": { + "chalk": "^2.3.0" + } + }, + "node_modules/logdown/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/logdown/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/logdown/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/logdown/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/logdown/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/logdown/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/logdown/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/lowercase-keys": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", @@ -9817,6 +9934,33 @@ } } }, + "cypress-failed-log": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/cypress-failed-log/-/cypress-failed-log-2.10.0.tgz", + "integrity": "sha512-v+GsOcpCAgj335zfDy9jDnaujH31SM/6pEQBp0dH0clbYu4NSXirLRXW9WoKhd0j70UrAA0hTLNbS2oTt1Y5kA==", + "dev": true, + "requires": { + "debug": "4.3.4", + "logdown": "3.3.1" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -12082,6 +12226,73 @@ } } }, + "logdown": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/logdown/-/logdown-3.3.1.tgz", + "integrity": "sha512-pjX0vlIJsYQlgVzFba2amXI1wZZnhrEorL68MdLI7B0/sN1TNUozBNFaHfcPHMM3A+INZ0OXFDxtnoaEgOmGjQ==", + "dev": true, + "requires": { + "chalk": "^2.3.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "lowercase-keys": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", diff --git a/package.json b/package.json index 1901a784d..a83ae8e5a 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ }, "devDependencies": { "cypress": "^9.5.1", + "cypress-failed-log": "^2.10.0", "eslint": "^8.10.0", "eslint-plugin-cypress": "^2.8.1", "eslint-plugin-jest": "^22.21.0", From 93350e0a77feb32fbea76d71d8ac77266b658f93 Mon Sep 17 00:00:00 2001 From: Barlowi2023 Date: Fri, 16 Jun 2023 16:48:33 +0100 Subject: [PATCH 38/63] added the likes functionality and fixed broken profile link --- controllers/posts.js | 24 ++++++++++++++++++++++-- controllers/posts_temp.js | 0 models/post.js | 12 +++++++----- models/post_temp.js | 0 routes/posts.js | 2 ++ views/posts/index.hbs | 5 ++++- 6 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 controllers/posts_temp.js create mode 100644 models/post_temp.js diff --git a/controllers/posts.js b/controllers/posts.js index 2a385ad9f..2f99b554f 100644 --- a/controllers/posts.js +++ b/controllers/posts.js @@ -11,10 +11,30 @@ const PostsController = { }); }, New: (req, res) => { - res.render("posts/new", {isAuthenticated: true}); + res.render("posts/new", {user: req.session.user, isAuthenticated: true}); }, + + AddLike: (req, res) => { + const post_id = req.params.id; + console.log(post_id); + console.log("xxxxxxx"); + // const user_id = req.session.user._id; + // const post = Post.findOne({ _id: post_id }); + // const likes = post.like + 1; + + + Post.findOneAndUpdate( + { _id: post_id }, + { $inc: { likes: 1 }}, + { new: true, useFindAndModify: false }, + () => {res.status(201).redirect("/posts");} + + ); + + }, + Create: (req, res) => { - const { message, likes } = req.body; + const { message, likes } = req.body; const username = req.session.user.username; const now = new Date(); const options = { diff --git a/controllers/posts_temp.js b/controllers/posts_temp.js new file mode 100644 index 000000000..e69de29bb diff --git a/models/post.js b/models/post.js index 4ce8fb70c..04bbf2549 100644 --- a/models/post.js +++ b/models/post.js @@ -1,11 +1,13 @@ const mongoose = require("mongoose"); +// const Schema = require("mongoose").Schema; const PostSchema = new mongoose.Schema({ - username: String, - message: String, - likes: { type: Number, default: 0 }, - currentDate: { type: String } -}); + username: {type: String}, + // userId: { type: Schema.Types.ObjectId, ref: "User" }, + message: {type: String, maxLength: 256}, + likes: {type: Number}, + // currentDate: {type: String} +}, { timestamps: true } ); const Post = mongoose.model("Post", PostSchema); diff --git a/models/post_temp.js b/models/post_temp.js new file mode 100644 index 000000000..e69de29bb diff --git a/routes/posts.js b/routes/posts.js index d4ec2d937..bf0e6c928 100644 --- a/routes/posts.js +++ b/routes/posts.js @@ -6,5 +6,7 @@ const PostsController = require("../controllers/posts"); router.get("/", PostsController.Index); router.post("/", PostsController.Create); router.get("/new", PostsController.New); +router.post("/:id/likes", PostsController.AddLike); + module.exports = router; diff --git a/views/posts/index.hbs b/views/posts/index.hbs index eda0327de..edfea7b15 100644 --- a/views/posts/index.hbs +++ b/views/posts/index.hbs @@ -1,7 +1,7 @@

          Timeline

            {{#each posts}} -
          • Created at: {{this.currentDate}}
          • +
          • Created at: {{this.createdAt}}

          • {{{this.username}}}

          • @@ -9,6 +9,9 @@
          • {{{this.likes}}} likes

          • +
            + +
            {{/each}}
          From b55a53582bf204f428768ca6aa3ee85092081814 Mon Sep 17 00:00:00 2001 From: Yousef Hafez Date: Fri, 16 Jun 2023 17:08:13 +0100 Subject: [PATCH 39/63] posts now appear on the profile page --- controllers/users.js | 24 ++++++++++++++++-------- views/users/profile.hbs | 12 ++++++++++-- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/controllers/users.js b/controllers/users.js index 62c4b7258..82b6f86c3 100644 --- a/controllers/users.js +++ b/controllers/users.js @@ -20,17 +20,25 @@ const UsersController = { res.status(201).redirect("/sessions/login"); }); }, - UserProfile: (req, res) => { + + + UserProfile: async (req, res) => { const username = req.params.username; - - User.findOne({ username }, (err, user) => { - if (err) { - throw err; - } - res.render("users/profile", { user, isAuthenticated: true }); - }); + + let posts = await Post.find({username}) + let user = await User.findOne({username}) + console.log(posts) + res.render("users/profile", {user, isAuthenticated: true, posts: posts}); + + // User.findOne({ username }, (err, user) => { + // if (err) { + // throw err; + // } + // res.render("users/profile", { user, isAuthenticated: true }); + // }); }, + CreatePost: (req, res) => { const username = req.params.username; const postContent = req.body.content; diff --git a/views/users/profile.hbs b/views/users/profile.hbs index 206c6e962..808e956d3 100644 --- a/views/users/profile.hbs +++ b/views/users/profile.hbs @@ -4,11 +4,19 @@ {{!-- add all other profile information needed above--}} -

          Create Post

          +{{!--

          Create Post

          -
          + --}} +New post + +

          Posts:

          +
            + {{#each posts}} +
          • {{this.message}}
          • + {{/each}} +
          {{!-- mabye can display all current posts made by users under create posts --}} \ No newline at end of file From f8f3c1e8a3ea2f197bd87b28dc1cf0dc2df20a0a Mon Sep 17 00:00:00 2001 From: Saamiya96 Date: Sun, 18 Jun 2023 14:53:10 +0100 Subject: [PATCH 40/63] minor change --- controllers/users.js | 1 - 1 file changed, 1 deletion(-) diff --git a/controllers/users.js b/controllers/users.js index 82b6f86c3..4bedbf981 100644 --- a/controllers/users.js +++ b/controllers/users.js @@ -21,7 +21,6 @@ const UsersController = { }); }, - UserProfile: async (req, res) => { const username = req.params.username; From f5c537989bba186e84eae835d58a7a10a98987eb Mon Sep 17 00:00:00 2001 From: Saamiya96 Date: Sun, 18 Jun 2023 14:55:50 +0100 Subject: [PATCH 41/63] made changes to signup and authentication --- controllers/sessions.js | 39 +- controllers/users.js | 135 +++--- localhost_2023-06-16_11-35-54.report.html | 282 ----------- models/user.js | 37 +- package-lock.json | 556 ++++++++++++++++++++-- package.json | 1 + routes/sessions.js | 1 - routes/users.js | 2 +- views/sessions/login.hbs | 17 +- views/users/signup.hbs | 44 +- 10 files changed, 712 insertions(+), 402 deletions(-) delete mode 100644 localhost_2023-06-16_11-35-54.report.html diff --git a/controllers/sessions.js b/controllers/sessions.js index 849ad3fec..7b9c76445 100644 --- a/controllers/sessions.js +++ b/controllers/sessions.js @@ -1,40 +1,41 @@ -const User = require("../models/user"); +const User = require('../models/user'); +const bcrypt = require('bcrypt'); const SessionsController = { + New: (req, res) => { - // res.render("sessions/new", {}); - res.render("sessions/login", {}); + res.render('sessions/login', {}); }, Create: (req, res) => { - console.log("trying to log in"); + console.log('trying to log in'); const email = req.body.email; const password = req.body.password; - User.findOne({ email: email }).then((user) => { if (!user) { - // res.redirect("/sessions/new"); - res.redirect("/sessions/login"); - } else if (user.password != password) { - // res.redirect("/sessions/new"); - res.redirect("/sessions/login"); + res.redirect('/sessions/login'); } else { - req.session.user = user; - res.redirect("/posts"); + bcrypt.compare(password, user.password, function (err, result) { + if (err) { + throw err; + } + if (result === true) { + req.session.user = user; + res.redirect('/posts'); + } else { + res.redirect('/sessions/login'); + } + }); } }); }, - - - Destroy: (req, res) => { - console.log("logging out"); + console.log('logging out!!!!!!!!!!'); if (req.session.user && req.cookies.user_sid) { - res.clearCookie("user_sid"); + res.clearCookie('user_sid'); } - // res.redirect("/sessions/new"); - res.redirect("/sessions/login"); + res.redirect('/sessions/login'); }, }; diff --git a/controllers/users.js b/controllers/users.js index 4bedbf981..342beb972 100644 --- a/controllers/users.js +++ b/controllers/users.js @@ -1,26 +1,28 @@ const User = require("../models/user"); -const Post = require("../models/post"); - +const Post = require("../models/post"); const UsersController = { + New: (req, res) => { - // res.render("users/new", {}); res.render("users/signup", {}); - }, Create: (req, res) => { - const user = new User(req.body); + const user = new User({ + username: req.body.username, + email: req.body.email, + password: req.body.password, + }); user.save((err) => { if (err) { throw err; + } else { + res.status(201).redirect("/sessions/login"); } - // Updated the code to redirect the user to the login page after successful sign-up. - // This allows the user to log in and ensures that the navbar dynamically adjusts based on the user's login status. - res.status(201).redirect("/sessions/login"); }); }, +<<<<<<< Updated upstream UserProfile: async (req, res) => { const username = req.params.username; @@ -35,60 +37,83 @@ const UsersController = { // } // res.render("users/profile", { user, isAuthenticated: true }); // }); +======= + Authenticate: function (req, res) { + var form = req.body; + User.findOne({ username: form.username }, function (err, user) { + if (err) { + throw err; + } + if (!user) { + res.render("/login", { + error: "Error: User not found", + }); + } + if (user) { + if (form.password == user.password) { + res.cookie("userId", user.id); + res.cookie("username", user.username); + res.redirect("/posts"); + } else { + res.redirect("/login"); + } + } + }); +>>>>>>> Stashed changes }, + UserProfile: async (req, res) => { + const username = req.params.username; + let posts = await Post.find({ username }); + let user = await User.findOne({ username }); + console.log(posts); + res.render("users/profile", { user, isAuthenticated: true, posts: posts }); + }, - CreatePost: (req, res) => { - const username = req.params.username; - const postContent = req.body.content; - - User.findOne({ username }, (err, user) => { - if (err || !user) { - res.status(404).send("User not found"); - } else { - const post = { - content: postContent, - author: user._id, - }; - user.posts.push(post); + CreatePost: (req, res) => { + const username = req.params.username; + const postContent = req.body.content; + User.findOne({ username }, (err, user) => { + if (err || !user) { + res.status(404).send("User not found"); + } else { + const post = { + content: postContent, + author: user._id, + }; + user.posts.push(post); - user.save((err) => { - if (err) { - throw err; - } - res.status(201).redirect(`/users/${username}`); - }); - } - }); + user.save((err) => { + if (err) { + throw err; + } + res.status(201).redirect(`/users/${username}`); + }); + } + }); }, - Show: (req, res) => { - const username = req.params.username; - User.findOne({ username }, (err, user) => { - if (err || !user) { - - res.status(404).send("User not found"); - } else { - - res.render("users/profile", { user }); - } - }); - }, - - EditPost: (req, res) => { - const postId = req.params.postId; - // Fetch the post from the database based on the provided postId - Post.findOne({ _id: postId }, (err, post) => { - if (err || !post) { - res.status(404).send("Post not found"); - } else { - res.render("posts/edit", { post }); - } - }); - }, + Show: (req, res) => { + const username = req.params.username; + User.findOne({ username }, (err, user) => { + if (err || !user) { + res.status(404).send("User not found"); + } else { + res.render("users/profile", { user }); + } + }); + }, + EditPost: (req, res) => { + const postId = req.params.postId; + Post.findOne({ _id: postId }, (err, post) => { + if (err || !post) { + res.status(404).send("Post not found"); + } else { + res.render("posts/edit", { post }); + } + }); + }, }; - - module.exports = UsersController; diff --git a/localhost_2023-06-16_11-35-54.report.html b/localhost_2023-06-16_11-35-54.report.html deleted file mode 100644 index a197f933b..000000000 --- a/localhost_2023-06-16_11-35-54.report.html +++ /dev/null @@ -1,282 +0,0 @@ - - - - - - - - Lighthouse Report - - - - - -
          - - - - - - diff --git a/models/user.js b/models/user.js index 169ad3efc..c10718071 100644 --- a/models/user.js +++ b/models/user.js @@ -1,9 +1,10 @@ const mongoose = require("mongoose"); +const bcrypt = require('bcrypt'); const UserSchema = new mongoose.Schema({ - username: {type: String, required: true}, - email: { type: String, required: true }, - password: { type: String, required: true }, + username: String, + email: String, + password: String, posts: [ { content: String, @@ -15,9 +16,37 @@ const UserSchema = new mongoose.Schema({ ], }); +UserSchema.statics.authenticate = function(email, password, callback){ + User.findOne({email: email}) + .exec(function(err,user){ + if(err) { + return callback(err) + } else if (!user) { + err.status = 401; + return callback(err); + } + bcrypt.compare(password, user.password, function(err, result){ + if (result === true) { + return callback(null, user); + } else{ + return callback(); + } + }) + }); +} +UserSchema.pre('save', function(next){ + var user = this; + bcrypt.hash(user.password, 10, function(err, hash){ + if(err){ + return next(err); + } + user.password = hash; + next(); + }) +}); + const User = mongoose.model("User", UserSchema); module.exports = User; -// need to add username to the schema \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index dfc9a77fc..7b8c6a0f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "0.0.0", "license": "CC BY-NC-SA", "dependencies": { + "bcrypt": "^5.1.0", "cookie-parser": "~1.4.4", "debug": "~2.6.9", "express": "~4.16.1", @@ -1142,6 +1143,39 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@mapbox/node-pre-gyp": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.10.tgz", + "integrity": "sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==", + "dependencies": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/@sindresorhus/is": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", @@ -1479,7 +1513,6 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "dev": true, "dependencies": { "debug": "4" }, @@ -1491,7 +1524,6 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -1507,8 +1539,7 @@ "node_modules/agent-base/node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/aggregate-error": { "version": "3.1.0", @@ -1617,6 +1648,11 @@ "node": ">= 8" } }, + "node_modules/aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==" + }, "node_modules/arch": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/arch/-/arch-2.2.0.tgz", @@ -1637,6 +1673,31 @@ } ] }, + "node_modules/are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/are-we-there-yet/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -1844,6 +1905,19 @@ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, + "node_modules/bcrypt": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/bcrypt/-/bcrypt-5.1.0.tgz", + "integrity": "sha512-RHBS7HI5N5tEnGTmtR/pppX0mmDSBpQ4aCBsj7CEQfYXDcO74A8sIBYcJMuCsis2E81zDxeENYhv66oZwLiA+Q==", + "hasInstallScript": true, + "dependencies": { + "@mapbox/node-pre-gyp": "^1.0.10", + "node-addon-api": "^5.0.0" + }, + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", @@ -2216,6 +2290,14 @@ "node": ">= 6" } }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "engines": { + "node": ">=10" + } + }, "node_modules/ci-info": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", @@ -2342,6 +2424,14 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "bin": { + "color-support": "bin.js" + } + }, "node_modules/colorette": { "version": "2.0.16", "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.16.tgz", @@ -2399,6 +2489,11 @@ "node": ">=8" } }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" + }, "node_modules/content-disposition": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", @@ -2722,6 +2817,11 @@ "node": ">=0.4.0" } }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==" + }, "node_modules/denque": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/denque/-/denque-1.5.1.tgz", @@ -2743,6 +2843,14 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" }, + "node_modules/detect-libc": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", + "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==", + "engines": { + "node": ">=8" + } + }, "node_modules/detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", @@ -3717,11 +3825,32 @@ "node": ">=10" } }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "node_modules/fsevents": { "version": "2.3.2", @@ -3748,6 +3877,25 @@ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, + "node_modules/gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -3811,7 +3959,6 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -3945,6 +4092,11 @@ "node": ">=8" } }, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==" + }, "node_modules/has-yarn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", @@ -4058,7 +4210,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "dev": true, "dependencies": { "agent-base": "6", "debug": "4" @@ -4071,7 +4222,6 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -4087,8 +4237,7 @@ "node_modules/https-proxy-agent/node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/human-signals": { "version": "1.1.1", @@ -4208,7 +4357,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -5864,6 +6012,48 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" }, + "node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/mongodb": { "version": "3.7.3", "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.7.3.tgz", @@ -6031,6 +6221,49 @@ "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==" }, + "node_modules/node-addon-api": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz", + "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==" + }, + "node_modules/node-fetch": { + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz", + "integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-fetch/node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "node_modules/node-fetch/node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/node-fetch/node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -6153,12 +6386,31 @@ "node": ">=8" } }, + "node_modules/npmlog": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "dependencies": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, "node_modules/nwsapi": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", "dev": true }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/on-finished": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", @@ -6373,7 +6625,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -6842,7 +7093,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, "dependencies": { "glob": "^7.1.3" }, @@ -6980,6 +7230,11 @@ "node": ">= 0.8.0" } }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" + }, "node_modules/setprototypeof": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", @@ -7275,6 +7530,22 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, + "node_modules/tar": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.15.tgz", + "integrity": "sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A==", + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/terminal-link": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", @@ -7797,6 +8068,14 @@ "node": ">= 8" } }, + "node_modules/wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, "node_modules/widest-line": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", @@ -8813,6 +9092,32 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "@mapbox/node-pre-gyp": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.10.tgz", + "integrity": "sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==", + "requires": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "dependencies": { + "nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "requires": { + "abbrev": "1" + } + } + } + }, "@sindresorhus/is": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", @@ -9109,7 +9414,6 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "dev": true, "requires": { "debug": "4" }, @@ -9118,7 +9422,6 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, "requires": { "ms": "2.1.2" } @@ -9126,8 +9429,7 @@ "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" } } }, @@ -9206,12 +9508,38 @@ "picomatch": "^2.0.4" } }, + "aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==" + }, "arch": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/arch/-/arch-2.2.0.tgz", "integrity": "sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==", "dev": true }, + "are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, "argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -9371,6 +9699,15 @@ } } }, + "bcrypt": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/bcrypt/-/bcrypt-5.1.0.tgz", + "integrity": "sha512-RHBS7HI5N5tEnGTmtR/pppX0mmDSBpQ4aCBsj7CEQfYXDcO74A8sIBYcJMuCsis2E81zDxeENYhv66oZwLiA+Q==", + "requires": { + "@mapbox/node-pre-gyp": "^1.0.10", + "node-addon-api": "^5.0.0" + } + }, "bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", @@ -9636,6 +9973,11 @@ } } }, + "chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==" + }, "ci-info": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", @@ -9732,6 +10074,11 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, + "color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==" + }, "colorette": { "version": "2.0.16", "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.16.tgz", @@ -9777,6 +10124,11 @@ "xdg-basedir": "^4.0.0" } }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" + }, "content-disposition": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", @@ -10043,6 +10395,11 @@ "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", "dev": true }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==" + }, "denque": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/denque/-/denque-1.5.1.tgz", @@ -10058,6 +10415,11 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" }, + "detect-libc": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", + "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==" + }, "detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", @@ -10804,11 +11166,28 @@ "universalify": "^2.0.0" } }, + "fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "requires": { + "minipass": "^3.0.0" + }, + "dependencies": { + "minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "requires": { + "yallist": "^4.0.0" + } + } + } + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { "version": "2.3.2", @@ -10828,6 +11207,22 @@ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, + "gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "requires": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + } + }, "gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -10876,7 +11271,6 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -10971,6 +11365,11 @@ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==" + }, "has-yarn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", @@ -11059,7 +11458,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "dev": true, "requires": { "agent-base": "6", "debug": "4" @@ -11069,7 +11467,6 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, "requires": { "ms": "2.1.2" } @@ -11077,8 +11474,7 @@ "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" } } }, @@ -11153,7 +11549,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -12430,6 +12825,35 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" }, + "minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==" + }, + "minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "requires": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "dependencies": { + "minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "requires": { + "yallist": "^4.0.0" + } + } + } + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" + }, "mongodb": { "version": "3.7.3", "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.7.3.tgz", @@ -12552,6 +12976,40 @@ "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==" }, + "node-addon-api": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz", + "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==" + }, + "node-fetch": { + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz", + "integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==", + "requires": { + "whatwg-url": "^5.0.0" + }, + "dependencies": { + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + } + } + }, "node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -12641,12 +13099,28 @@ "path-key": "^3.0.0" } }, + "npmlog": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "requires": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, "nwsapi": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", "dev": true }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==" + }, "on-finished": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", @@ -12802,8 +13276,7 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-key": { "version": "3.1.1", @@ -13166,7 +13639,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, "requires": { "glob": "^7.1.3" } @@ -13262,6 +13734,11 @@ "send": "0.16.2" } }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" + }, "setprototypeof": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", @@ -13492,6 +13969,19 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, + "tar": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.15.tgz", + "integrity": "sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A==", + "requires": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + } + }, "terminal-link": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", @@ -13905,6 +14395,14 @@ "isexe": "^2.0.0" } }, + "wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "requires": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, "widest-line": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", diff --git a/package.json b/package.json index a83ae8e5a..965640d98 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "node": ">=18.1.0" }, "dependencies": { + "bcrypt": "^5.1.0", "cookie-parser": "~1.4.4", "debug": "~2.6.9", "express": "~4.16.1", diff --git a/routes/sessions.js b/routes/sessions.js index 4fe6455e6..118bbd92c 100644 --- a/routes/sessions.js +++ b/routes/sessions.js @@ -4,7 +4,6 @@ const router = express.Router(); const SessionsController = require("../controllers/sessions"); router.get("/login", SessionsController.New); -// router.get("/signup", SessionsController.New); router.post("/", SessionsController.Create); router.delete("/", SessionsController.Destroy); diff --git a/routes/users.js b/routes/users.js index 31484c006..19c808336 100644 --- a/routes/users.js +++ b/routes/users.js @@ -3,9 +3,9 @@ const router = express.Router(); const UsersController = require("../controllers/users"); -// router.get("/new", UsersController.New); router.get("/signup", UsersController.New); router.post("/", UsersController.Create); +router.post("/login", UsersController.Authenticate); router.get("/:username", UsersController.UserProfile); router.post("/:username/posts", UsersController.CreatePost); diff --git a/views/sessions/login.hbs b/views/sessions/login.hbs index 86de20b62..04d72ba45 100644 --- a/views/sessions/login.hbs +++ b/views/sessions/login.hbs @@ -1,7 +1,20 @@
          + - + + - + +
          diff --git a/views/users/signup.hbs b/views/users/signup.hbs index 638efa08f..2d8f5a809 100644 --- a/views/users/signup.hbs +++ b/views/users/signup.hbs @@ -1,11 +1,37 @@ -
          - - - - - - - -
          +
          +
          + + + + + + + + + + +
          +
          From a81c4ae76aeb6a9f63559c1af82fdfdaab2a7931 Mon Sep 17 00:00:00 2001 From: Saamiya96 Date: Sun, 18 Jun 2023 14:57:15 +0100 Subject: [PATCH 42/63] minor change --- controllers/users.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/controllers/users.js b/controllers/users.js index 342beb972..19d11ec99 100644 --- a/controllers/users.js +++ b/controllers/users.js @@ -22,22 +22,6 @@ const UsersController = { }); }, -<<<<<<< Updated upstream - UserProfile: async (req, res) => { - const username = req.params.username; - - let posts = await Post.find({username}) - let user = await User.findOne({username}) - console.log(posts) - res.render("users/profile", {user, isAuthenticated: true, posts: posts}); - - // User.findOne({ username }, (err, user) => { - // if (err) { - // throw err; - // } - // res.render("users/profile", { user, isAuthenticated: true }); - // }); -======= Authenticate: function (req, res) { var form = req.body; User.findOne({ username: form.username }, function (err, user) { @@ -59,7 +43,6 @@ const UsersController = { } } }); ->>>>>>> Stashed changes }, UserProfile: async (req, res) => { From 5ada18f794d7722d264bbc9cc45ee6141130dfe2 Mon Sep 17 00:00:00 2001 From: Saamiya96 Date: Sun, 18 Jun 2023 15:42:21 +0100 Subject: [PATCH 43/63] minor change --- controllers/sessions.js | 7 +++---- controllers/users.js | 8 ++++---- models/user.js | 1 + views/layout.hbs | 1 - views/sessions/login.hbs | 3 +++ views/users/signup.hbs | 3 ++- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/controllers/sessions.js b/controllers/sessions.js index 7b9c76445..3aa80eed1 100644 --- a/controllers/sessions.js +++ b/controllers/sessions.js @@ -29,13 +29,12 @@ const SessionsController = { } }); }, - Destroy: (req, res) => { - console.log('logging out!!!!!!!!!!'); + console.log("logging out"); if (req.session.user && req.cookies.user_sid) { - res.clearCookie('user_sid'); + res.clearCookie("user_sid"); } - res.redirect('/sessions/login'); + res.redirect("/sessions/login"); }, }; diff --git a/controllers/users.js b/controllers/users.js index 19d11ec99..ca98d5363 100644 --- a/controllers/users.js +++ b/controllers/users.js @@ -29,17 +29,17 @@ const UsersController = { throw err; } if (!user) { - res.render("/login", { + res.render("/sessions/login", { error: "Error: User not found", }); } if (user) { if (form.password == user.password) { - res.cookie("userId", user.id); - res.cookie("username", user.username); + // res.cookie("userId", user.id); + res.cookie("email", user.email); res.redirect("/posts"); } else { - res.redirect("/login"); + res.redirect("/sessions/login"); } } }); diff --git a/models/user.js b/models/user.js index c10718071..58cb9dd4a 100644 --- a/models/user.js +++ b/models/user.js @@ -34,6 +34,7 @@ UserSchema.statics.authenticate = function(email, password, callback){ }) }); } + UserSchema.pre('save', function(next){ var user = this; bcrypt.hash(user.password, 10, function(err, hash){ diff --git a/views/layout.hbs b/views/layout.hbs index 8483d1dcc..7118dcd2d 100644 --- a/views/layout.hbs +++ b/views/layout.hbs @@ -6,7 +6,6 @@ -{{!-- Authentication for user's login status which is linked to the controller sessions.js file under the Create method --}}