From f32cf9cd6edf1710a27e52b591177b4c17794f7b Mon Sep 17 00:00:00 2001 From: Liz Hennessy Date: Fri, 8 Nov 2024 11:41:10 -0700 Subject: [PATCH 1/4] update photos --- .../src/components/__tests__/module-detail.js | 40 ++++++++++--------- .../__tests__/modules-navigation.js | 36 ++++++++--------- .../src/components/__tests__/track-detail.js | 26 ++++++------ client/src/containers/__tests__/track-card.js | 24 ++++++----- .../src/components/__tests__/module-detail.js | 40 ++++++++++--------- .../__tests__/modules-navigation.js | 36 ++++++++--------- .../src/components/__tests__/track-detail.js | 26 ++++++------ .../src/containers/__tests__/track-card.js | 24 ++++++----- final/server/src/index.js | 22 +++++----- 9 files changed, 144 insertions(+), 130 deletions(-) diff --git a/client/src/components/__tests__/module-detail.js b/client/src/components/__tests__/module-detail.js index 6c1422cc..77d365ea 100644 --- a/client/src/components/__tests__/module-detail.js +++ b/client/src/components/__tests__/module-detail.js @@ -1,46 +1,48 @@ -import React from 'react'; -import { renderWithRouter, cleanup } from '../../utils/test-utils'; -import ModuleDetail from '../module-detail'; +import React from "react"; +import { renderWithRouter, cleanup } from "../../utils/test-utils"; +import ModuleDetail from "../module-detail"; const mockModule = { - id: 'l_1', - title: 'The Night Sky', + id: "l_1", + title: "The Night Sky", content: - '# Et tempus voces tigride remisso fer coimus\n\n## Montibus arbusta detrectas haud\n\n', + "# Et tempus voces tigride remisso fer coimus\n\n## Montibus arbusta detrectas haud\n\n", thumbnail: null, - videoUrl: 'https://youtu.be/dlKzlksOUtU', - topic: 'Cat-stronomy', + videoUrl: "https://youtu.be/dlKzlksOUtU", + topic: "Cat-stronomy", length: 164, }; const mockParentTrack = { - id: 'c_0', - title: 'Cat-stronomy, an introduction', - description: '# Pulchra vehi vidit misera sola armenta secabatur\n\n', + id: "c_0", + title: "Cat-stronomy, an introduction", + description: "# Pulchra vehi vidit misera sola armenta secabatur\n\n", thumbnail: - 'https://res.cloudinary.com/dety84pbu/image/upload/v1598465568/nebula_cat_djkt9r.jpg', + "https://res.cloudinary.com/apollographql/image/upload/v1730818804/odyssey/lift-off-api/nebula_cat_djkt9r_nzifdj.jpg", trackLength: 2377, modulesCount: 10, numberOfViews: 51, author: { - name: 'Henri, le Chat Noir', + name: "Henri, le Chat Noir", photo: - 'https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0', + "https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0", }, modules: [ { - id: 'l_0', - title: 'Exploring Time and Space', + id: "l_0", + title: "Exploring Time and Space", length: 258, }, ], }; -describe('Module Detail View', () => { +describe("Module Detail View", () => { // automatically unmount and cleanup DOM after the test is finished. afterEach(cleanup); - it('renders without error', () => { - renderWithRouter(); + it("renders without error", () => { + renderWithRouter( + + ); }); }); diff --git a/client/src/components/__tests__/modules-navigation.js b/client/src/components/__tests__/modules-navigation.js index f7d0c2e2..d0be3e9e 100644 --- a/client/src/components/__tests__/modules-navigation.js +++ b/client/src/components/__tests__/modules-navigation.js @@ -1,46 +1,46 @@ -import React from 'react'; -import { renderWithRouter, cleanup } from '../../utils/test-utils'; -import ModuleNav from '../modules-navigation'; +import React from "react"; +import { renderWithRouter, cleanup } from "../../utils/test-utils"; +import ModuleNav from "../modules-navigation"; const mockModule = { - id: 'l_1', - title: 'The Night Sky', + id: "l_1", + title: "The Night Sky", content: - '# Et tempus voces tigride remisso fer coimus\n\n## Montibus arbusta detrectas haud\n\n', + "# Et tempus voces tigride remisso fer coimus\n\n## Montibus arbusta detrectas haud\n\n", thumbnail: null, - videoUrl: 'https://youtu.be/dlKzlksOUtU', - topic: 'Cat-stronomy', + videoUrl: "https://youtu.be/dlKzlksOUtU", + topic: "Cat-stronomy", length: 164, }; const mockParentTrack = { - id: 'c_0', - title: 'Cat-stronomy, an introduction', - description: '# Pulchra vehi vidit misera sola armenta secabatur\n\n', + id: "c_0", + title: "Cat-stronomy, an introduction", + description: "# Pulchra vehi vidit misera sola armenta secabatur\n\n", thumbnail: - 'https://res.cloudinary.com/dety84pbu/image/upload/v1598465568/nebula_cat_djkt9r.jpg', + "https://res.cloudinary.com/apollographql/image/upload/v1730818804/odyssey/lift-off-api/nebula_cat_djkt9r_nzifdj.jpg", trackLength: 2377, modulesCount: 10, numberOfViews: 51, author: { - name: 'Henri, le Chat Noir', + name: "Henri, le Chat Noir", photo: - 'https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0', + "https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0", }, modules: [ { - id: 'l_0', - title: 'Exploring Time and Space', + id: "l_0", + title: "Exploring Time and Space", length: 258, }, ], }; -describe('Modules Navigation View', () => { +describe("Modules Navigation View", () => { // automatically unmount and cleanup DOM after the test is finished. afterEach(cleanup); - it('renders without error', () => { + it("renders without error", () => { renderWithRouter(); }); }); diff --git a/client/src/components/__tests__/track-detail.js b/client/src/components/__tests__/track-detail.js index 86f84542..24694631 100644 --- a/client/src/components/__tests__/track-detail.js +++ b/client/src/components/__tests__/track-detail.js @@ -1,37 +1,37 @@ -import React from 'react'; -import { renderWithRouter, cleanup } from '../../utils/test-utils'; -import TrackDetail from '../track-detail'; +import React from "react"; +import { renderWithRouter, cleanup } from "../../utils/test-utils"; +import TrackDetail from "../track-detail"; const mockTrack = { track: { - id: 'c_0', - title: 'Cat-stronomy, an introduction', - description: '# Pulchra vehi vidit misera sola armenta secabatur\n\n', + id: "c_0", + title: "Cat-stronomy, an introduction", + description: "# Pulchra vehi vidit misera sola armenta secabatur\n\n", thumbnail: - 'https://res.cloudinary.com/dety84pbu/image/upload/v1598465568/nebula_cat_djkt9r.jpg', + "https://res.cloudinary.com/apollographql/image/upload/v1730818804/odyssey/lift-off-api/nebula_cat_djkt9r_nzifdj.jpg", length: 2377, modulesCount: 10, numberOfViews: 51, author: { - name: 'Henri, le Chat Noir', + name: "Henri, le Chat Noir", photo: - 'https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0', + "https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0", }, modules: [ { - id: 'l_0', - title: 'Exploring Time and Space', + id: "l_0", + title: "Exploring Time and Space", length: 258, }, ], }, }; -describe('Module Detail View', () => { +describe("Module Detail View", () => { // automatically unmount and cleanup DOM after the test is finished. afterEach(cleanup); - it('renders without error', () => { + it("renders without error", () => { renderWithRouter(); }); }); diff --git a/client/src/containers/__tests__/track-card.js b/client/src/containers/__tests__/track-card.js index 39c5ff2c..217336a7 100644 --- a/client/src/containers/__tests__/track-card.js +++ b/client/src/containers/__tests__/track-card.js @@ -1,25 +1,29 @@ -import React from 'react'; -import { renderApolloWithRouter, cleanup, waitForElement } from '../../utils/test-utils'; -import TrackCard from '../track-card'; +import React from "react"; +import { + renderApolloWithRouter, + cleanup, + waitForElement, +} from "../../utils/test-utils"; +import TrackCard from "../track-card"; const mockTrackCardData = { - id: 'c_0', - title: 'Cat-stronomy, an introduction', + id: "c_0", + title: "Cat-stronomy, an introduction", thumbnail: - 'https://res.cloudinary.com/dety84pbu/image/upload/v1598465568/nebula_cat_djkt9r.jpg', + "https://res.cloudinary.com/apollographql/image/upload/v1730818804/odyssey/lift-off-api/nebula_cat_djkt9r_nzifdj.jpg", length: 2377, author: { - name: 'Henri, le Chat Noir', + name: "Henri, le Chat Noir", photo: - 'https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0', + "https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0", }, }; -describe('Track Card', () => { +describe("Track Card", () => { // automatically unmount and cleanup DOM after the test is finished. afterEach(cleanup); - it('renders track Card', async () => { + it("renders track Card", async () => { const mocks = []; const { getByText } = await renderApolloWithRouter( , diff --git a/final/client/src/components/__tests__/module-detail.js b/final/client/src/components/__tests__/module-detail.js index 6c1422cc..77d365ea 100644 --- a/final/client/src/components/__tests__/module-detail.js +++ b/final/client/src/components/__tests__/module-detail.js @@ -1,46 +1,48 @@ -import React from 'react'; -import { renderWithRouter, cleanup } from '../../utils/test-utils'; -import ModuleDetail from '../module-detail'; +import React from "react"; +import { renderWithRouter, cleanup } from "../../utils/test-utils"; +import ModuleDetail from "../module-detail"; const mockModule = { - id: 'l_1', - title: 'The Night Sky', + id: "l_1", + title: "The Night Sky", content: - '# Et tempus voces tigride remisso fer coimus\n\n## Montibus arbusta detrectas haud\n\n', + "# Et tempus voces tigride remisso fer coimus\n\n## Montibus arbusta detrectas haud\n\n", thumbnail: null, - videoUrl: 'https://youtu.be/dlKzlksOUtU', - topic: 'Cat-stronomy', + videoUrl: "https://youtu.be/dlKzlksOUtU", + topic: "Cat-stronomy", length: 164, }; const mockParentTrack = { - id: 'c_0', - title: 'Cat-stronomy, an introduction', - description: '# Pulchra vehi vidit misera sola armenta secabatur\n\n', + id: "c_0", + title: "Cat-stronomy, an introduction", + description: "# Pulchra vehi vidit misera sola armenta secabatur\n\n", thumbnail: - 'https://res.cloudinary.com/dety84pbu/image/upload/v1598465568/nebula_cat_djkt9r.jpg', + "https://res.cloudinary.com/apollographql/image/upload/v1730818804/odyssey/lift-off-api/nebula_cat_djkt9r_nzifdj.jpg", trackLength: 2377, modulesCount: 10, numberOfViews: 51, author: { - name: 'Henri, le Chat Noir', + name: "Henri, le Chat Noir", photo: - 'https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0', + "https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0", }, modules: [ { - id: 'l_0', - title: 'Exploring Time and Space', + id: "l_0", + title: "Exploring Time and Space", length: 258, }, ], }; -describe('Module Detail View', () => { +describe("Module Detail View", () => { // automatically unmount and cleanup DOM after the test is finished. afterEach(cleanup); - it('renders without error', () => { - renderWithRouter(); + it("renders without error", () => { + renderWithRouter( + + ); }); }); diff --git a/final/client/src/components/__tests__/modules-navigation.js b/final/client/src/components/__tests__/modules-navigation.js index f7d0c2e2..d0be3e9e 100644 --- a/final/client/src/components/__tests__/modules-navigation.js +++ b/final/client/src/components/__tests__/modules-navigation.js @@ -1,46 +1,46 @@ -import React from 'react'; -import { renderWithRouter, cleanup } from '../../utils/test-utils'; -import ModuleNav from '../modules-navigation'; +import React from "react"; +import { renderWithRouter, cleanup } from "../../utils/test-utils"; +import ModuleNav from "../modules-navigation"; const mockModule = { - id: 'l_1', - title: 'The Night Sky', + id: "l_1", + title: "The Night Sky", content: - '# Et tempus voces tigride remisso fer coimus\n\n## Montibus arbusta detrectas haud\n\n', + "# Et tempus voces tigride remisso fer coimus\n\n## Montibus arbusta detrectas haud\n\n", thumbnail: null, - videoUrl: 'https://youtu.be/dlKzlksOUtU', - topic: 'Cat-stronomy', + videoUrl: "https://youtu.be/dlKzlksOUtU", + topic: "Cat-stronomy", length: 164, }; const mockParentTrack = { - id: 'c_0', - title: 'Cat-stronomy, an introduction', - description: '# Pulchra vehi vidit misera sola armenta secabatur\n\n', + id: "c_0", + title: "Cat-stronomy, an introduction", + description: "# Pulchra vehi vidit misera sola armenta secabatur\n\n", thumbnail: - 'https://res.cloudinary.com/dety84pbu/image/upload/v1598465568/nebula_cat_djkt9r.jpg', + "https://res.cloudinary.com/apollographql/image/upload/v1730818804/odyssey/lift-off-api/nebula_cat_djkt9r_nzifdj.jpg", trackLength: 2377, modulesCount: 10, numberOfViews: 51, author: { - name: 'Henri, le Chat Noir', + name: "Henri, le Chat Noir", photo: - 'https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0', + "https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0", }, modules: [ { - id: 'l_0', - title: 'Exploring Time and Space', + id: "l_0", + title: "Exploring Time and Space", length: 258, }, ], }; -describe('Modules Navigation View', () => { +describe("Modules Navigation View", () => { // automatically unmount and cleanup DOM after the test is finished. afterEach(cleanup); - it('renders without error', () => { + it("renders without error", () => { renderWithRouter(); }); }); diff --git a/final/client/src/components/__tests__/track-detail.js b/final/client/src/components/__tests__/track-detail.js index 86f84542..24694631 100644 --- a/final/client/src/components/__tests__/track-detail.js +++ b/final/client/src/components/__tests__/track-detail.js @@ -1,37 +1,37 @@ -import React from 'react'; -import { renderWithRouter, cleanup } from '../../utils/test-utils'; -import TrackDetail from '../track-detail'; +import React from "react"; +import { renderWithRouter, cleanup } from "../../utils/test-utils"; +import TrackDetail from "../track-detail"; const mockTrack = { track: { - id: 'c_0', - title: 'Cat-stronomy, an introduction', - description: '# Pulchra vehi vidit misera sola armenta secabatur\n\n', + id: "c_0", + title: "Cat-stronomy, an introduction", + description: "# Pulchra vehi vidit misera sola armenta secabatur\n\n", thumbnail: - 'https://res.cloudinary.com/dety84pbu/image/upload/v1598465568/nebula_cat_djkt9r.jpg', + "https://res.cloudinary.com/apollographql/image/upload/v1730818804/odyssey/lift-off-api/nebula_cat_djkt9r_nzifdj.jpg", length: 2377, modulesCount: 10, numberOfViews: 51, author: { - name: 'Henri, le Chat Noir', + name: "Henri, le Chat Noir", photo: - 'https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0', + "https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0", }, modules: [ { - id: 'l_0', - title: 'Exploring Time and Space', + id: "l_0", + title: "Exploring Time and Space", length: 258, }, ], }, }; -describe('Module Detail View', () => { +describe("Module Detail View", () => { // automatically unmount and cleanup DOM after the test is finished. afterEach(cleanup); - it('renders without error', () => { + it("renders without error", () => { renderWithRouter(); }); }); diff --git a/final/client/src/containers/__tests__/track-card.js b/final/client/src/containers/__tests__/track-card.js index 39c5ff2c..217336a7 100644 --- a/final/client/src/containers/__tests__/track-card.js +++ b/final/client/src/containers/__tests__/track-card.js @@ -1,25 +1,29 @@ -import React from 'react'; -import { renderApolloWithRouter, cleanup, waitForElement } from '../../utils/test-utils'; -import TrackCard from '../track-card'; +import React from "react"; +import { + renderApolloWithRouter, + cleanup, + waitForElement, +} from "../../utils/test-utils"; +import TrackCard from "../track-card"; const mockTrackCardData = { - id: 'c_0', - title: 'Cat-stronomy, an introduction', + id: "c_0", + title: "Cat-stronomy, an introduction", thumbnail: - 'https://res.cloudinary.com/dety84pbu/image/upload/v1598465568/nebula_cat_djkt9r.jpg', + "https://res.cloudinary.com/apollographql/image/upload/v1730818804/odyssey/lift-off-api/nebula_cat_djkt9r_nzifdj.jpg", length: 2377, author: { - name: 'Henri, le Chat Noir', + name: "Henri, le Chat Noir", photo: - 'https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0', + "https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0", }, }; -describe('Track Card', () => { +describe("Track Card", () => { // automatically unmount and cleanup DOM after the test is finished. afterEach(cleanup); - it('renders track Card', async () => { + it("renders track Card", async () => { const mocks = []; const { getByText } = await renderApolloWithRouter( , diff --git a/final/server/src/index.js b/final/server/src/index.js index c872a546..bcc8cf20 100644 --- a/final/server/src/index.js +++ b/final/server/src/index.js @@ -1,24 +1,26 @@ -const { ApolloServer } = require('@apollo/server'); -const { startStandaloneServer } = require('@apollo/server/standalone'); -const { addMocksToSchema } = require('@graphql-tools/mock'); -const { makeExecutableSchema } = require('@graphql-tools/schema'); +const { ApolloServer } = require("@apollo/server"); +const { startStandaloneServer } = require("@apollo/server/standalone"); +const { addMocksToSchema } = require("@graphql-tools/mock"); +const { makeExecutableSchema } = require("@graphql-tools/schema"); -const typeDefs = require('./schema'); +const typeDefs = require("./schema"); const mocks = { Query: () => ({ tracksForHome: () => [...new Array(6)], }), Track: () => ({ - id: () => 'track_01', - title: () => 'Astro Kitty, Space Explorer', + id: () => "track_01", + title: () => "Astro Kitty, Space Explorer", author: () => { return { - name: 'Grumpy Cat', - photo: 'https://res.cloudinary.com/dety84pbu/image/upload/v1606816219/kitty-veyron-sm_mctf3c.jpg', + name: "Grumpy Cat", + photo: + "https://res.cloudinary.com/dety84pbu/image/upload/v1606816219/kitty-veyron-sm_mctf3c.jpg", }; }, - thumbnail: () => 'https://res.cloudinary.com/dety84pbu/image/upload/v1598465568/nebula_cat_djkt9r.jpg', + thumbnail: () => + "https://res.cloudinary.com/apollographql/image/upload/v1730818804/odyssey/lift-off-api/nebula_cat_djkt9r_nzifdj.jpg", length: () => 1210, modulesCount: () => 6, }), From 52fb2aff21c2e7c1854b0ae8efa45aaa0abe1eab Mon Sep 17 00:00:00 2001 From: Liz Hennessy Date: Fri, 8 Nov 2024 11:43:44 -0700 Subject: [PATCH 2/4] undo double quote --- .../src/components/__tests__/module-detail.js | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/client/src/components/__tests__/module-detail.js b/client/src/components/__tests__/module-detail.js index 77d365ea..61072865 100644 --- a/client/src/components/__tests__/module-detail.js +++ b/client/src/components/__tests__/module-detail.js @@ -1,46 +1,46 @@ -import React from "react"; -import { renderWithRouter, cleanup } from "../../utils/test-utils"; -import ModuleDetail from "../module-detail"; +import React from 'react'; +import { renderWithRouter, cleanup } from '../../utils/test-utils'; +import ModuleDetail from '../module-detail'; const mockModule = { - id: "l_1", - title: "The Night Sky", + id: 'l_1', + title: 'The Night Sky', content: - "# Et tempus voces tigride remisso fer coimus\n\n## Montibus arbusta detrectas haud\n\n", + '# Et tempus voces tigride remisso fer coimus\n\n## Montibus arbusta detrectas haud\n\n', thumbnail: null, - videoUrl: "https://youtu.be/dlKzlksOUtU", - topic: "Cat-stronomy", + videoUrl: 'https://youtu.be/dlKzlksOUtU', + topic: 'Cat-stronomy', length: 164, }; const mockParentTrack = { - id: "c_0", - title: "Cat-stronomy, an introduction", - description: "# Pulchra vehi vidit misera sola armenta secabatur\n\n", + id: 'c_0', + title: 'Cat-stronomy, an introduction', + description: '# Pulchra vehi vidit misera sola armenta secabatur\n\n', thumbnail: - "https://res.cloudinary.com/apollographql/image/upload/v1730818804/odyssey/lift-off-api/nebula_cat_djkt9r_nzifdj.jpg", + 'https://res.cloudinary.com/apollographql/image/upload/v1730818804/odyssey/lift-off-api/nebula_cat_djkt9r_nzifdj.jpg', trackLength: 2377, modulesCount: 10, numberOfViews: 51, author: { - name: "Henri, le Chat Noir", + name: 'Henri, le Chat Noir', photo: - "https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0", + 'https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0', }, modules: [ { - id: "l_0", - title: "Exploring Time and Space", + id: 'l_0', + title: 'Exploring Time and Space', length: 258, }, ], }; -describe("Module Detail View", () => { +describe('Module Detail View', () => { // automatically unmount and cleanup DOM after the test is finished. afterEach(cleanup); - it("renders without error", () => { + it('renders without error', () => { renderWithRouter( ); From d84e12c58c40e0ace9c7d9a5f3c7edb3dafd6b64 Mon Sep 17 00:00:00 2001 From: Liz Hennessy Date: Fri, 8 Nov 2024 11:44:39 -0700 Subject: [PATCH 3/4] undo double quotes --- .../__tests__/modules-navigation.js | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/client/src/components/__tests__/modules-navigation.js b/client/src/components/__tests__/modules-navigation.js index d0be3e9e..15c14a77 100644 --- a/client/src/components/__tests__/modules-navigation.js +++ b/client/src/components/__tests__/modules-navigation.js @@ -1,46 +1,46 @@ -import React from "react"; -import { renderWithRouter, cleanup } from "../../utils/test-utils"; -import ModuleNav from "../modules-navigation"; +import React from 'react'; +import { renderWithRouter, cleanup } from '../../utils/test-utils'; +import ModuleNav from '../modules-navigation'; const mockModule = { - id: "l_1", - title: "The Night Sky", + id: 'l_1', + title: 'The Night Sky', content: - "# Et tempus voces tigride remisso fer coimus\n\n## Montibus arbusta detrectas haud\n\n", + '# Et tempus voces tigride remisso fer coimus\n\n## Montibus arbusta detrectas haud\n\n', thumbnail: null, - videoUrl: "https://youtu.be/dlKzlksOUtU", - topic: "Cat-stronomy", + videoUrl: 'https://youtu.be/dlKzlksOUtU', + topic: 'Cat-stronomy', length: 164, }; const mockParentTrack = { - id: "c_0", - title: "Cat-stronomy, an introduction", - description: "# Pulchra vehi vidit misera sola armenta secabatur\n\n", + id: 'c_0', + title: 'Cat-stronomy, an introduction', + description: '# Pulchra vehi vidit misera sola armenta secabatur\n\n', thumbnail: - "https://res.cloudinary.com/apollographql/image/upload/v1730818804/odyssey/lift-off-api/nebula_cat_djkt9r_nzifdj.jpg", + 'https://res.cloudinary.com/apollographql/image/upload/v1730818804/odyssey/lift-off-api/nebula_cat_djkt9r_nzifdj.jpg', trackLength: 2377, modulesCount: 10, numberOfViews: 51, author: { - name: "Henri, le Chat Noir", + name: 'Henri, le Chat Noir', photo: - "https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0", + 'https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0', }, modules: [ { - id: "l_0", - title: "Exploring Time and Space", + id: 'l_0', + title: 'Exploring Time and Space', length: 258, }, ], }; -describe("Modules Navigation View", () => { +describe('Modules Navigation View', () => { // automatically unmount and cleanup DOM after the test is finished. afterEach(cleanup); - it("renders without error", () => { + it('renders without error', () => { renderWithRouter(); }); }); From de317c9e0a5d8e267f60a93960b918c9395ac795 Mon Sep 17 00:00:00 2001 From: Liz Hennessy Date: Fri, 8 Nov 2024 11:48:46 -0700 Subject: [PATCH 4/4] undo double quote --- .../src/components/__tests__/track-detail.js | 26 +++++++------- client/src/containers/__tests__/track-card.js | 20 +++++------ .../src/components/__tests__/module-detail.js | 36 +++++++++---------- .../__tests__/modules-navigation.js | 36 +++++++++---------- .../src/components/__tests__/track-detail.js | 26 +++++++------- .../src/containers/__tests__/track-card.js | 20 +++++------ final/server/src/index.js | 20 +++++------ 7 files changed, 92 insertions(+), 92 deletions(-) diff --git a/client/src/components/__tests__/track-detail.js b/client/src/components/__tests__/track-detail.js index 24694631..5d917d0d 100644 --- a/client/src/components/__tests__/track-detail.js +++ b/client/src/components/__tests__/track-detail.js @@ -1,37 +1,37 @@ -import React from "react"; -import { renderWithRouter, cleanup } from "../../utils/test-utils"; -import TrackDetail from "../track-detail"; +import React from 'react'; +import { renderWithRouter, cleanup } from '../../utils/test-utils'; +import TrackDetail from '../track-detail'; const mockTrack = { track: { - id: "c_0", - title: "Cat-stronomy, an introduction", - description: "# Pulchra vehi vidit misera sola armenta secabatur\n\n", + id: 'c_0', + title: 'Cat-stronomy, an introduction', + description: '# Pulchra vehi vidit misera sola armenta secabatur\n\n', thumbnail: - "https://res.cloudinary.com/apollographql/image/upload/v1730818804/odyssey/lift-off-api/nebula_cat_djkt9r_nzifdj.jpg", + 'https://res.cloudinary.com/apollographql/image/upload/v1730818804/odyssey/lift-off-api/nebula_cat_djkt9r_nzifdj.jpg', length: 2377, modulesCount: 10, numberOfViews: 51, author: { - name: "Henri, le Chat Noir", + name: 'Henri, le Chat Noir', photo: - "https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0", + 'https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0', }, modules: [ { - id: "l_0", - title: "Exploring Time and Space", + id: 'l_0', + title: 'Exploring Time and Space', length: 258, }, ], }, }; -describe("Module Detail View", () => { +describe('Module Detail View', () => { // automatically unmount and cleanup DOM after the test is finished. afterEach(cleanup); - it("renders without error", () => { + it('renders without error', () => { renderWithRouter(); }); }); diff --git a/client/src/containers/__tests__/track-card.js b/client/src/containers/__tests__/track-card.js index 217336a7..d2e9295a 100644 --- a/client/src/containers/__tests__/track-card.js +++ b/client/src/containers/__tests__/track-card.js @@ -1,29 +1,29 @@ -import React from "react"; +import React from 'react'; import { renderApolloWithRouter, cleanup, waitForElement, -} from "../../utils/test-utils"; -import TrackCard from "../track-card"; +} from '../../utils/test-utils'; +import TrackCard from '../track-card'; const mockTrackCardData = { - id: "c_0", - title: "Cat-stronomy, an introduction", + id: 'c_0', + title: 'Cat-stronomy, an introduction', thumbnail: - "https://res.cloudinary.com/apollographql/image/upload/v1730818804/odyssey/lift-off-api/nebula_cat_djkt9r_nzifdj.jpg", + 'https://res.cloudinary.com/apollographql/image/upload/v1730818804/odyssey/lift-off-api/nebula_cat_djkt9r_nzifdj.jpg', length: 2377, author: { - name: "Henri, le Chat Noir", + name: 'Henri, le Chat Noir', photo: - "https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0", + 'https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0', }, }; -describe("Track Card", () => { +describe('Track Card', () => { // automatically unmount and cleanup DOM after the test is finished. afterEach(cleanup); - it("renders track Card", async () => { + it('renders track Card', async () => { const mocks = []; const { getByText } = await renderApolloWithRouter( , diff --git a/final/client/src/components/__tests__/module-detail.js b/final/client/src/components/__tests__/module-detail.js index 77d365ea..61072865 100644 --- a/final/client/src/components/__tests__/module-detail.js +++ b/final/client/src/components/__tests__/module-detail.js @@ -1,46 +1,46 @@ -import React from "react"; -import { renderWithRouter, cleanup } from "../../utils/test-utils"; -import ModuleDetail from "../module-detail"; +import React from 'react'; +import { renderWithRouter, cleanup } from '../../utils/test-utils'; +import ModuleDetail from '../module-detail'; const mockModule = { - id: "l_1", - title: "The Night Sky", + id: 'l_1', + title: 'The Night Sky', content: - "# Et tempus voces tigride remisso fer coimus\n\n## Montibus arbusta detrectas haud\n\n", + '# Et tempus voces tigride remisso fer coimus\n\n## Montibus arbusta detrectas haud\n\n', thumbnail: null, - videoUrl: "https://youtu.be/dlKzlksOUtU", - topic: "Cat-stronomy", + videoUrl: 'https://youtu.be/dlKzlksOUtU', + topic: 'Cat-stronomy', length: 164, }; const mockParentTrack = { - id: "c_0", - title: "Cat-stronomy, an introduction", - description: "# Pulchra vehi vidit misera sola armenta secabatur\n\n", + id: 'c_0', + title: 'Cat-stronomy, an introduction', + description: '# Pulchra vehi vidit misera sola armenta secabatur\n\n', thumbnail: - "https://res.cloudinary.com/apollographql/image/upload/v1730818804/odyssey/lift-off-api/nebula_cat_djkt9r_nzifdj.jpg", + 'https://res.cloudinary.com/apollographql/image/upload/v1730818804/odyssey/lift-off-api/nebula_cat_djkt9r_nzifdj.jpg', trackLength: 2377, modulesCount: 10, numberOfViews: 51, author: { - name: "Henri, le Chat Noir", + name: 'Henri, le Chat Noir', photo: - "https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0", + 'https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0', }, modules: [ { - id: "l_0", - title: "Exploring Time and Space", + id: 'l_0', + title: 'Exploring Time and Space', length: 258, }, ], }; -describe("Module Detail View", () => { +describe('Module Detail View', () => { // automatically unmount and cleanup DOM after the test is finished. afterEach(cleanup); - it("renders without error", () => { + it('renders without error', () => { renderWithRouter( ); diff --git a/final/client/src/components/__tests__/modules-navigation.js b/final/client/src/components/__tests__/modules-navigation.js index d0be3e9e..15c14a77 100644 --- a/final/client/src/components/__tests__/modules-navigation.js +++ b/final/client/src/components/__tests__/modules-navigation.js @@ -1,46 +1,46 @@ -import React from "react"; -import { renderWithRouter, cleanup } from "../../utils/test-utils"; -import ModuleNav from "../modules-navigation"; +import React from 'react'; +import { renderWithRouter, cleanup } from '../../utils/test-utils'; +import ModuleNav from '../modules-navigation'; const mockModule = { - id: "l_1", - title: "The Night Sky", + id: 'l_1', + title: 'The Night Sky', content: - "# Et tempus voces tigride remisso fer coimus\n\n## Montibus arbusta detrectas haud\n\n", + '# Et tempus voces tigride remisso fer coimus\n\n## Montibus arbusta detrectas haud\n\n', thumbnail: null, - videoUrl: "https://youtu.be/dlKzlksOUtU", - topic: "Cat-stronomy", + videoUrl: 'https://youtu.be/dlKzlksOUtU', + topic: 'Cat-stronomy', length: 164, }; const mockParentTrack = { - id: "c_0", - title: "Cat-stronomy, an introduction", - description: "# Pulchra vehi vidit misera sola armenta secabatur\n\n", + id: 'c_0', + title: 'Cat-stronomy, an introduction', + description: '# Pulchra vehi vidit misera sola armenta secabatur\n\n', thumbnail: - "https://res.cloudinary.com/apollographql/image/upload/v1730818804/odyssey/lift-off-api/nebula_cat_djkt9r_nzifdj.jpg", + 'https://res.cloudinary.com/apollographql/image/upload/v1730818804/odyssey/lift-off-api/nebula_cat_djkt9r_nzifdj.jpg', trackLength: 2377, modulesCount: 10, numberOfViews: 51, author: { - name: "Henri, le Chat Noir", + name: 'Henri, le Chat Noir', photo: - "https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0", + 'https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0', }, modules: [ { - id: "l_0", - title: "Exploring Time and Space", + id: 'l_0', + title: 'Exploring Time and Space', length: 258, }, ], }; -describe("Modules Navigation View", () => { +describe('Modules Navigation View', () => { // automatically unmount and cleanup DOM after the test is finished. afterEach(cleanup); - it("renders without error", () => { + it('renders without error', () => { renderWithRouter(); }); }); diff --git a/final/client/src/components/__tests__/track-detail.js b/final/client/src/components/__tests__/track-detail.js index 24694631..5d917d0d 100644 --- a/final/client/src/components/__tests__/track-detail.js +++ b/final/client/src/components/__tests__/track-detail.js @@ -1,37 +1,37 @@ -import React from "react"; -import { renderWithRouter, cleanup } from "../../utils/test-utils"; -import TrackDetail from "../track-detail"; +import React from 'react'; +import { renderWithRouter, cleanup } from '../../utils/test-utils'; +import TrackDetail from '../track-detail'; const mockTrack = { track: { - id: "c_0", - title: "Cat-stronomy, an introduction", - description: "# Pulchra vehi vidit misera sola armenta secabatur\n\n", + id: 'c_0', + title: 'Cat-stronomy, an introduction', + description: '# Pulchra vehi vidit misera sola armenta secabatur\n\n', thumbnail: - "https://res.cloudinary.com/apollographql/image/upload/v1730818804/odyssey/lift-off-api/nebula_cat_djkt9r_nzifdj.jpg", + 'https://res.cloudinary.com/apollographql/image/upload/v1730818804/odyssey/lift-off-api/nebula_cat_djkt9r_nzifdj.jpg', length: 2377, modulesCount: 10, numberOfViews: 51, author: { - name: "Henri, le Chat Noir", + name: 'Henri, le Chat Noir', photo: - "https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0", + 'https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0', }, modules: [ { - id: "l_0", - title: "Exploring Time and Space", + id: 'l_0', + title: 'Exploring Time and Space', length: 258, }, ], }, }; -describe("Module Detail View", () => { +describe('Module Detail View', () => { // automatically unmount and cleanup DOM after the test is finished. afterEach(cleanup); - it("renders without error", () => { + it('renders without error', () => { renderWithRouter(); }); }); diff --git a/final/client/src/containers/__tests__/track-card.js b/final/client/src/containers/__tests__/track-card.js index 217336a7..d2e9295a 100644 --- a/final/client/src/containers/__tests__/track-card.js +++ b/final/client/src/containers/__tests__/track-card.js @@ -1,29 +1,29 @@ -import React from "react"; +import React from 'react'; import { renderApolloWithRouter, cleanup, waitForElement, -} from "../../utils/test-utils"; -import TrackCard from "../track-card"; +} from '../../utils/test-utils'; +import TrackCard from '../track-card'; const mockTrackCardData = { - id: "c_0", - title: "Cat-stronomy, an introduction", + id: 'c_0', + title: 'Cat-stronomy, an introduction', thumbnail: - "https://res.cloudinary.com/apollographql/image/upload/v1730818804/odyssey/lift-off-api/nebula_cat_djkt9r_nzifdj.jpg", + 'https://res.cloudinary.com/apollographql/image/upload/v1730818804/odyssey/lift-off-api/nebula_cat_djkt9r_nzifdj.jpg', length: 2377, author: { - name: "Henri, le Chat Noir", + name: 'Henri, le Chat Noir', photo: - "https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0", + 'https://images.unsplash.com/photo-1442291928580-fb5d0856a8f1?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzA0OH0', }, }; -describe("Track Card", () => { +describe('Track Card', () => { // automatically unmount and cleanup DOM after the test is finished. afterEach(cleanup); - it("renders track Card", async () => { + it('renders track Card', async () => { const mocks = []; const { getByText } = await renderApolloWithRouter( , diff --git a/final/server/src/index.js b/final/server/src/index.js index bcc8cf20..04e1e895 100644 --- a/final/server/src/index.js +++ b/final/server/src/index.js @@ -1,26 +1,26 @@ -const { ApolloServer } = require("@apollo/server"); -const { startStandaloneServer } = require("@apollo/server/standalone"); -const { addMocksToSchema } = require("@graphql-tools/mock"); -const { makeExecutableSchema } = require("@graphql-tools/schema"); +const { ApolloServer } = require('@apollo/server'); +const { startStandaloneServer } = require('@apollo/server/standalone'); +const { addMocksToSchema } = require('@graphql-tools/mock'); +const { makeExecutableSchema } = require('@graphql-tools/schema'); -const typeDefs = require("./schema"); +const typeDefs = require('./schema'); const mocks = { Query: () => ({ tracksForHome: () => [...new Array(6)], }), Track: () => ({ - id: () => "track_01", - title: () => "Astro Kitty, Space Explorer", + id: () => 'track_01', + title: () => 'Astro Kitty, Space Explorer', author: () => { return { - name: "Grumpy Cat", + name: 'Grumpy Cat', photo: - "https://res.cloudinary.com/dety84pbu/image/upload/v1606816219/kitty-veyron-sm_mctf3c.jpg", + 'https://res.cloudinary.com/dety84pbu/image/upload/v1606816219/kitty-veyron-sm_mctf3c.jpg', }; }, thumbnail: () => - "https://res.cloudinary.com/apollographql/image/upload/v1730818804/odyssey/lift-off-api/nebula_cat_djkt9r_nzifdj.jpg", + 'https://res.cloudinary.com/apollographql/image/upload/v1730818804/odyssey/lift-off-api/nebula_cat_djkt9r_nzifdj.jpg', length: () => 1210, modulesCount: () => 6, }),