Skip to content

Commit

Permalink
Merge pull request #94 from alexlee-dev/v1.6.0
Browse files Browse the repository at this point in the history
📦 v1.6.0
  • Loading branch information
Alex Lee authored Aug 17, 2020
2 parents e6611e3 + bcafad0 commit 2b78de1
Show file tree
Hide file tree
Showing 30 changed files with 403 additions and 315 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,27 @@ 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.6.0] - 2020-08-17

### 🐛 Bug Fixeroo

### Added

### Changed

- Hide hidden jobs in search results - [#79](https://github.com/alexlee-dev/gh-jobs/issues/79)
- Single `ErrorResponse` type for error responses - [#88](https://github.com/alexlee-dev/gh-jobs/issues/88)

### Removed

- Template Configuration - [#93](https://github.com/alexlee-dev/gh-jobs/issues/93)

### Fixed

- `unique()` function not working as expected, resulting in search results containing more entires than jobs in DB - [#85](https://github.com/alexlee-dev/gh-jobs/issues/85)
- Now able to access `Details` page with a direct url - [#80](https://github.com/alexlee-dev/gh-jobs/issues/80)
- `ProfileAccountStats` container width spilling out on mobile - [#93](https://github.com/alexlee-dev/gh-jobs/issues/93)

## [1.5.0] - 2020-08-15

### ⏹️ Button Redesign
Expand Down
4 changes: 2 additions & 2 deletions cypress/integration/applicationError.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ context("Application Error", () => {
cy.fixture("jobs50").then((jobsJson) => {
cy.server();
cy.route({
method: "GET",
method: "POST",
url: "/jobs",
status: 200,
response: jobsJson,
delay: 1000,
});
cy.route({
method: "GET",
url: "/jobs/search?full_time=false&contract=false&description=react",
url: "/jobs/search?userId=&full_time=false&contract=false&description=react",
status: 200,
response: {},
delay: 1000,
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/details.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ context("Details", () => {
cy.fixture("jobDetails").then((jobDetails) => {
cy.server();
cy.route({
method: "GET",
method: "POST",
url: "/jobs",
status: 200,
response: jobsJson,
Expand Down
29 changes: 19 additions & 10 deletions cypress/integration/directPageAccess.spec.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
/// <reference types="cypress" />

context("Details", () => {
context("Direct Page Access", () => {
beforeEach(() => {
cy.fixture("jobs50").then((jobsJson) => {
cy.server();
cy.route({
method: "GET",
url: "/jobs",
status: 200,
response: jobsJson,
delay: 1000,
cy.fixture("jobDetails").then((jobDetailsJson) => {
cy.server();
cy.route({
method: "POST",
url: "/jobs",
status: 200,
response: jobsJson,
delay: 1000,
});
cy.route({
method: "GET",
url: "/jobs/f1884b46-ecb4-473c-81f5-08d9bf2ab3bb",
status: 200,
response: jobDetailsJson,
delay: 1000,
});
});
});
});
Expand All @@ -28,8 +37,8 @@ context("Details", () => {
cy.get("h1").should("have.text", "Create Account");
});

it("Should be able to access '/jobs/:id' directly", () => {
cy.visit("http://localhost:3000/jobs/f1884b46-ecb4-473c-81f5-08d9bf2ab3bb");
it("Should be able to access '/jobDetails/:id' directly", () => {
cy.visit("http://localhost:3000/jobDetails/f1884b46-ecb4-473c-81f5-08d9bf2ab3bb");
cy.wait(500);

cy.get("h2").should("have.text", "Cloud DevOps Engineer");
Expand Down
64 changes: 48 additions & 16 deletions cypress/integration/hiddenJobs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,29 @@ context("Hidden Jobs", () => {
beforeEach(() => {
cy.fixture("jobs50").then((jobsJson) => {
cy.fixture("hiddenDetails").then((hiddenDetailsJson) => {
cy.server();
cy.route({
method: "GET",
url: "/jobs",
status: 200,
response: jobsJson,
delay: 1000,
});
cy.route({
method: "GET",
url: "/user/hiddenJobsDetails",
status: 200,
response: hiddenDetailsJson,
delay: 1000,
cy.fixture("jobDetails").then((jobDetailsJson) => {
cy.server();
cy.route({
method: "POST",
url: "/jobs",
status: 200,
response: jobsJson,
delay: 1000,
});
cy.route({
method: "GET",
url: "/user/hiddenJobsDetails",
status: 200,
response: hiddenDetailsJson,
delay: 1000,
});
cy.route({
method: "GET",
url: "/jobs/f1884b46-ecb4-473c-81f5-08d9bf2ab3bb",
status: 200,
response: jobDetailsJson,
delay: 1000,
});
});
});
});
Expand Down Expand Up @@ -223,14 +232,37 @@ context("Hidden Jobs", () => {
cy.get("#show-job-72de09f2-5bc6-489f-be90-3d38e505e20a").click();
cy.get("#show-job-cc20d9f2-0102-4785-8253-66093d3ca5c0").click();
});

// ! Unable to do with current implementation
// * If you don't stub it, the real db may not contain that job listing anymore
// * If you do stub it, you can't conditionally send a smaller list of jobs each time it hits /user/hiddenJobDetails
it.skip("Should not display hidden jobs in currentJobs", () => {
// * Hide a job
cy.get("#hide-job-f1884b46-ecb4-473c-81f5-08d9bf2ab3bb").click();
// * Log User out
cy.get("#nav-profile").click();
cy.get("#settings").click();
cy.get("#log-out").click();

cy.get("#f1884b46-ecb4-473c-81f5-08d9bf2ab3bb").should("exist");

// * Log In
cy.get("#nav-login").click();
cy.get("#email").type("[email protected]");
cy.get("#password").type("Red123456!!!");
cy.get("#log-in").click();
cy.wait(500);

cy.get("#f1884b46-ecb4-473c-81f5-08d9bf2ab3bb").should("not.exist");
});
});

context("Hidden Jobs - No Results", () => {
beforeEach(() => {
cy.fixture("jobs50").then((jobsJson) => {
cy.server();
cy.route({
method: "GET",
method: "POST",
url: "/jobs",
status: 200,
response: jobsJson,
Expand All @@ -254,7 +286,7 @@ context("Hidden Jobs - No Results", () => {
cy.get("#nav-profile").click();
cy.get("#view-hidden-jobs").click();

assert.equal(cy.state("requests").length, 3);
assert.equal(cy.state("requests").length, 4);
});

it("Should display correct text", () => {
Expand Down
4 changes: 2 additions & 2 deletions cypress/integration/login.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ context("Login - Success", () => {
cy.fixture("login").then((loginJson) => {
cy.server();
cy.route({
method: "GET",
method: "POST",
url: "/jobs",
status: 200,
response: jobsJson,
Expand Down Expand Up @@ -48,7 +48,7 @@ context("Login - Error", () => {
cy.fixture("jobs50").then((jobsJson) => {
cy.server();
cy.route({
method: "GET",
method: "POST",
url: "/jobs",
status: 200,
response: jobsJson,
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/notification.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ context("Notification", () => {
cy.fixture("jobs50").then((jobsJson) => {
cy.server();
cy.route({
method: "GET",
method: "POST",
url: "/jobs",
status: 200,
response: jobsJson,
Expand Down
14 changes: 7 additions & 7 deletions cypress/integration/optionsPanel.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,55 +8,55 @@ context("Options Panel", () => {
cy.fixture("jobsSearch3").then((jobsSearch3Json) => {
cy.server();
cy.route({
method: "GET",
method: "POST",
url: "/jobs",
status: 200,
response: jobsJson,
});
cy.route({
method: "GET",
url:
"/jobs/search?full_time=true&contract=false&description=developer",
"/jobs/search?userId=&full_time=true&contract=false&description=developer",
status: 200,
delay: 1000,
response: jobsSearch2Json,
});
cy.route({
method: "GET",
url:
"/jobs/search?full_time=false&contract=false&description=&location1=Los Angeles",
"/jobs/search?userId=&full_time=false&contract=false&description=&location1=Los Angeles",
status: 200,
delay: 1000,
response: jobsSearch1Json,
});
cy.route({
method: "GET",
url:
"/jobs/search?full_time=false&contract=false&description=&location1=Chicago",
"/jobs/search?userId=&full_time=false&contract=false&description=&location1=Chicago",
status: 200,
delay: 1000,
response: jobsSearch1Json,
});
cy.route({
method: "GET",
url:
"/jobs/search?full_time=false&contract=false&description=developer",
"/jobs/search?userId=&full_time=false&contract=false&description=developer",
status: 200,
delay: 1000,
response: jobsSearch1Json,
});
cy.route({
method: "GET",
url:
"/jobs/search?full_time=false&contract=false&description=&location1=Los Angeles",
"/jobs/search?userId=&full_time=false&contract=false&description=&location1=Los Angeles",
status: 200,
delay: 1000,
response: jobsSearch1Json,
});
cy.route({
method: "GET",
url:
"/jobs/search?full_time=false&contract=true&description=developer",
"/jobs/search?userId=&full_time=false&contract=true&description=developer",
status: 200,
delay: 1000,
response: jobsSearch3Json,
Expand Down
12 changes: 6 additions & 6 deletions cypress/integration/pagination.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ context("Pagination", () => {
cy.fixture("jobs50").then((jobsJson) => {
cy.server();
cy.route({
method: "GET",
method: "POST",
url: "/jobs",
status: 200,
response: jobsJson,
Expand Down Expand Up @@ -213,7 +213,7 @@ context("Pagination", () => {
cy.server();
cy.route({
method: "GET",
url: "/jobs/search?full_time=false&contract=false&description=&location1=Chicago",
url: "/jobs/search?userId=&full_time=false&contract=false&description=&location1=Chicago",
status: 200,
response: jobsJson,
});
Expand Down Expand Up @@ -258,7 +258,7 @@ context("Pagination - 1 Page", () => {
cy.fixture("jobs5").then((jobsJson) => {
cy.server();
cy.route({
method: "GET",
method: "POST",
url: "/jobs",
status: 200,
response: jobsJson,
Expand Down Expand Up @@ -296,7 +296,7 @@ context("Pagination - 2 Pages", () => {
cy.fixture("jobs10").then((jobsJson) => {
cy.server();
cy.route({
method: "GET",
method: "POST",
url: "/jobs",
status: 200,
response: jobsJson,
Expand Down Expand Up @@ -334,7 +334,7 @@ context("Pagination - 3 Pages", () => {
cy.fixture("jobs15").then((jobsJson) => {
cy.server();
cy.route({
method: "GET",
method: "POST",
url: "/jobs",
status: 200,
response: jobsJson,
Expand Down Expand Up @@ -374,7 +374,7 @@ context("Pagination - 4 Pages", () => {
cy.fixture("jobs20").then((jobsJson) => {
cy.server();
cy.route({
method: "GET",
method: "POST",
url: "/jobs",
status: 200,
response: jobsJson,
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/profile.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ context("Profile", () => {
cy.fixture("jobs50").then((jobsJson) => {
cy.server();
cy.route({
method: "GET",
method: "POST",
url: "/jobs",
status: 200,
response: jobsJson,
Expand Down
Loading

0 comments on commit 2b78de1

Please sign in to comment.