Skip to content

Commit

Permalink
Merge pull request #37 from alexlee-dev/v1.1.0
Browse files Browse the repository at this point in the history
📦 v1.1.0
  • Loading branch information
Alex Lee authored Jul 24, 2020
2 parents 192c600 + dacd103 commit f99dd14
Show file tree
Hide file tree
Showing 56 changed files with 4,539 additions and 285 deletions.
20 changes: 0 additions & 20 deletions .env-cmdrc.json

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ node_modules/
build/
dist/
cypress/screenshots/
cypress/videos/
cypress/videos/
.env-cmdrc.json
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,35 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.0] - 2020-07-23

### 🦸‍♂️ User Profiles and Saved Jobs

### Added

- Ability to create a new profile
- Ability to login
- Ability to reset your password
- Ability to edit profile information
- Ability to save your favorite jobs to your profile
- `<Navigation />` component
- `Login` page
- `Signup` page
- `SavedJobs` page
- `<Button />` component
- Additional Cypress Testing

### Changed

- Path for `Details` page is now `/jobs/:id` instead of `/:id`
- `<Input />` now has optional `autoComplete` and `type` props
- `JobCard` style is slightly different in regards to information displayed in columns vs. rows
- Website is now hosted on [www.githubjobs.io](www.githubjobs.io)

### Removed

### Fixed

## [1.0.0] - 2020-07-19

### 🚀 Initial Release
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<br>
</p>

https://www.githubjobs.io/

## 📝 Table of Contents

- [About](#about)
Expand Down Expand Up @@ -40,10 +42,14 @@ View [my solution](https://devchallenges.io/solutions/Lwb0aAViU0LzUKL6kscT) on D

### Dependencies

- [@sendgrid/mail](https://github.com/sendgrid/sendgrid-nodejs) - The Official Twilio SendGrid Led, Community Driven Node.js API Library.
- [bcryptjs](https://github.com/dcodeIO/bcrypt.js) - Optimized bcrypt in plain JavaScript with zero dependencies.
- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right.
- [cookie-parser](https://github.com/expressjs/cookie-parser) - Parse HTTP request cookies.
- [cors](https://github.com/expressjs/cors) - Node.js CORS middleware.
- [date-fns](https://date-fns.org/) - ⏳ Modern JavaScript date utility library ⌛.
- [express](https://expressjs.com/) - Fast, unopinionated, minimalist web framework for node.
- [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken) - JsonWebToken implementation for node.js.
- [lodash.throttle](https://lodash.com/) - A modern JavaScript utility library delivering modularity, performance, & extras.
- [mongoose](https://mongoosejs.com/) - MongoDB object modeling designed to work in an asynchronous environment.
- [morgan](https://github.com/expressjs/morgan) - HTTP request logger middleware for node.js.
Expand All @@ -54,6 +60,7 @@ View [my solution](https://devchallenges.io/solutions/Lwb0aAViU0LzUKL6kscT) on D
- [react-router-dom](https://reactrouter.com/) - Declarative routing for React.
- [redux](https://redux.js.org/) - Predictable state container for JavaScript apps.
- [redux-thunk](https://github.com/reduxjs/redux-thunk) - Thunk middleware for Redux.
- [validator](https://github.com/validatorjs/validator.js) - String validation.

### DevDependencies

Expand Down
8 changes: 8 additions & 0 deletions cypress/fixtures/login.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"_id": "12345",
"email": "[email protected]",
"name": "Bob Test",
"createdAt": "2020-07-20T21:09:00.323Z",
"updatedAt": "2020-07-20T21:12:01.627Z",
"__v": 1
}
8 changes: 8 additions & 0 deletions cypress/fixtures/signup.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"_id": "12345",
"email": "[email protected]",
"name": "Bob Test",
"createdAt": "2020-07-20T21:09:00.323Z",
"updatedAt": "2020-07-20T21:12:01.627Z",
"__v": 1
}
6 changes: 2 additions & 4 deletions cypress/integration/details.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="cypress" />

context("Search", () => {
context("Details", () => {
beforeEach(() => {
cy.fixture("jobs50").then((jobsJson) => {
cy.server();
Expand All @@ -26,9 +26,7 @@ context("Search", () => {
cy.get(
"#app > div.details__container > div.details__main__container > div.details__container__title > div.details__container__title__inner > h2"
).should("have.text", "Cloud DevOps Engineer");
cy.get(
"#app > div.details__container > div.details__main__container > div.details__container__title > div.details__container__title__inner > p"
).should("have.text", "Full Time");
cy.get("#full-time-indicator").should("have.text", "Full Time");
cy.get(
"#app > div.details__container > div.details__main__container > div.details__container__company > div.details__company__right > a"
).should("have.text", "Cool Company");
Expand Down
71 changes: 71 additions & 0 deletions cypress/integration/login.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/// <reference types="cypress" />

context("Login - Success", () => {
beforeEach(() => {
cy.fixture("jobs50").then((jobsJson) => {
cy.fixture("login").then((loginJson) => {
cy.server();
cy.route({
method: "GET",
url: "/jobs",
status: 200,
response: jobsJson,
delay: 1000,
});
cy.route({
method: "POST",
url: "/user/login",
status: 200,
response: loginJson,
delay: 1000,
});
});
});
cy.visit("http://localhost:3000");
cy.wait(1000);
cy.get("#nav-login").click();
cy.get("h1").should("have.text", "Login");
});

it("Should be able to log in with existing account", () => {
cy.get("#email").type("[email protected]");
cy.get("#password").type("Red123456!!!");
cy.get("#log-in").click();
cy.wait(1500);

cy.get("#nav-login").should("not.exist");
cy.get("#search").should("be.visible");
});

it("Should be able to get to Signup from Login page", () => {
cy.get("#create-an-account").click();
cy.get("h1").should("have.text", "Create Account");
});
});

context("Login - Error", () => {
beforeEach(() => {
cy.fixture("jobs50").then((jobsJson) => {
cy.server();
cy.route({
method: "GET",
url: "/jobs",
status: 200,
response: jobsJson,
delay: 1000,
});
});
cy.visit("http://localhost:3000");
cy.wait(1000);
cy.get("#nav-login").click();
cy.get("h1").should("have.text", "Login");
});

it("Should not allow to login with invalid credentials", () => {
cy.get("#email").type("[email protected]");
cy.get("#password").type("Red123456!!!");
cy.get("#log-in").click();
cy.wait(500);
cy.get("#notification-text").should("have.text", "Invalid credentials.");
});
});
95 changes: 95 additions & 0 deletions cypress/integration/notification.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/// <reference types="cypress" />

context("Notification", () => {
beforeEach(() => {
cy.fixture("jobs50").then((jobsJson) => {
cy.server();
cy.route({
method: "GET",
url: "/jobs",
status: 200,
response: jobsJson,
delay: 1000,
});
});
cy.visit("http://localhost:3000");
cy.wait(1000);
});

it("Should reset the notification on initial load", () => {
cy.get("#nav-login").click();
cy.get("h1").should("have.text", "Login");
cy.get("#email").type("[email protected]");
cy.get("#password").type("Red123456!!!");
cy.get("#log-in").click();
cy.wait(1500);
cy.get("#nav-login").should("not.exist");
cy.get("#search").should("be.visible");
cy.get("#nav-profile").click();
cy.get("#edit").click();
cy.get("h1").should("have.text", "Edit Profile");
cy.get("#edit-name").clear();
cy.get("#edit-name").type("Cool Bob");
cy.get("#edit-confirm").click();

cy.wait(1500);

cy.get("h1").should("have.text", "Profile");
cy.get("#notification-text").should(
"have.text",
"Profile information updated successfully."
);

cy.reload();
cy.get("#nav-profile").click();
cy.get("#notification-text").should("not.exist");

// * Reset to normal data (Cleanup)
cy.get("#edit").click();
cy.get("#notification-text").should("not.exist");
cy.get("#edit-name").clear();
cy.get("#edit-name").type("Bob Test");
cy.get("#edit-confirm").click();
cy.wait(1500);
cy.get("h1").should("have.text", "Profile");
cy.get("#name").should("have.value", "Bob Test");
cy.get("#email").should("have.value", "[email protected]");
});

it("Should disappear after 5 seconds", () => {
cy.get("#nav-login").click();
cy.get("h1").should("have.text", "Login");
cy.get("#email").type("[email protected]");
cy.get("#password").type("Red123456!!!");
cy.get("#log-in").click();
cy.wait(1500);
cy.get("#nav-login").should("not.exist");
cy.get("#search").should("be.visible");
cy.get("#nav-profile").click();
cy.get("#edit").click();
cy.get("h1").should("have.text", "Edit Profile");
cy.get("#edit-name").clear();
cy.get("#edit-name").type("Cool Bob");
cy.get("#edit-confirm").click();

cy.wait(1500);

cy.get("h1").should("have.text", "Profile");
cy.get("#notification-text").should(
"have.text",
"Profile information updated successfully."
);
cy.wait(5000);
cy.get("#notification-text").should("not.exist");

// * Reset to normal data (Cleanup)
cy.get("#edit").click();
cy.get("#edit-name").clear();
cy.get("#edit-name").type("Bob Test");
cy.get("#edit-confirm").click();
cy.wait(1500);
cy.get("h1").should("have.text", "Profile");
cy.get("#name").should("have.value", "Bob Test");
cy.get("#email").should("have.value", "[email protected]");
});
});
10 changes: 5 additions & 5 deletions cypress/integration/optionsPanel.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ context("Options Panel", () => {
"#app > div.search__container > div.options-panel__container > label:nth-child(1) > span"
).click();
cy.get("#search").type("developer");
cy.get(".search__button").click();
cy.get("#search-submit").click();
cy.wait(1000);
cy.reload();
cy.get(
Expand All @@ -63,7 +63,7 @@ context("Options Panel", () => {
it("Should retain location search value", () => {
cy.get("#location-search").should("have.value", "");
cy.get("#location-search").type("Los Angeles");
cy.get(".search__button").click();
cy.get("#search-submit").click();
cy.wait(1000);
cy.get("#location-search").should("have.value", "Los Angeles");
});
Expand All @@ -74,14 +74,14 @@ context("Options Panel", () => {
"#app > div.search__container > div.options-panel__container > label:nth-child(3) > span"
).click();
cy.get("#location-1").should("be.checked");
cy.get(".search__button").click();
cy.get("#search-submit").click();
cy.wait(1000);
cy.get("#location-1").should("be.checked");
});

it("Should filter with fullTime correctly", () => {
cy.get("#search").type("developer");
cy.get(".search__button").click();
cy.get("#search-submit").click();

cy.wait(1500);
cy.get(".jobcard__container").then(($jobs) => {
Expand All @@ -91,7 +91,7 @@ context("Options Panel", () => {
cy.get(
"#app > div.search__container > div.options-panel__container > label:nth-child(1) > span"
).click();
cy.get(".search__button").click();
cy.get("#search-submit").click();

cy.wait(1500);
cy.get(".jobcard__container").then(($jobs) => {
Expand Down
Loading

0 comments on commit f99dd14

Please sign in to comment.