From 0605c048420243bf7f38b125c83e0f94267e8495 Mon Sep 17 00:00:00 2001
From: Purefallen11 <53922216+Purefallen11@users.noreply.github.com>
Date: Thu, 2 Sep 2021 14:31:31 -0500
Subject: [PATCH 1/3] working on episode.test
---
README.md | 10 +++++-----
src/App.test.js | 4 ++--
src/components/tests/Episode.test.js | 16 +++++++++++-----
3 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/README.md b/README.md
index 06fd745b..96cdd0d6 100644
--- a/README.md
+++ b/README.md
@@ -19,11 +19,11 @@ Get the project fired up and start using it as a user would. Try to go through t
## Instructions
### Task 1: Project Set Up
-* [ ] Create a forked copy of this project.
-* [ ] Clone your OWN version of the repository in your terminal
-* [ ] cd into the project base directory `cd web-module-project-reducer-pattern`
-* [ ] Download project dependencies by running `npm install`
-* [ ] Start up the app using `npm start`
+* [x] Create a forked copy of this project.
+* [x] Clone your OWN version of the repository in your terminal
+* [x] cd into the project base directory `cd web-module-project-reducer-pattern`
+* [x] Download project dependencies by running `npm install`
+* [x] Start up the app using `npm start`
- [ ] With each saved change in your editor, the test runner will re-run all the tests
- [ ] **IMPORTANT** If a test fails, use the test runner's error messages to find out why it is failing
diff --git a/src/App.test.js b/src/App.test.js
index c972892c..1811bd78 100644
--- a/src/App.test.js
+++ b/src/App.test.js
@@ -9,5 +9,5 @@ test('target dropdown', async ()=>{
const placeholder = screen.queryAllByPlaceholderText('Select an option');
console.log(placeholder);
});
-
-});
\ No newline at end of file
+
+});
diff --git a/src/components/tests/Episode.test.js b/src/components/tests/Episode.test.js
index 24b4c2dc..448c0563 100644
--- a/src/components/tests/Episode.test.js
+++ b/src/components/tests/Episode.test.js
@@ -13,19 +13,25 @@ const testEpisode = {
}
const testEpisodeWithoutImage = {
- //Add in approprate test data structure here.
+ id: 2,
+ name: "",
+ image: null,
+ season: 2,
+ number: 2,
+ summary: "",
+ runtime: 1
}
test("renders without error", () => {
-
+ render()
});
-test("renders the summury test passed as prop", ()=>{
-
+test("renders the summary test passed as prop", ()=>{
+ render()
});
test("renders default image when image is not defined", ()=>{
-
+ render()
})
//Tasks
From 21e53aa24a13f3757d7973646c3344acb0e90f87 Mon Sep 17 00:00:00 2001
From: Purefallen11 <53922216+Purefallen11@users.noreply.github.com>
Date: Thu, 2 Sep 2021 14:42:42 -0500
Subject: [PATCH 2/3] yup, have no idea what im doing.
---
src/components/tests/Display.test.js | 2 +-
src/components/tests/Episode.test.js | 9 +++++++--
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/components/tests/Display.test.js b/src/components/tests/Display.test.js
index 5a01416b..cf33bb56 100644
--- a/src/components/tests/Display.test.js
+++ b/src/components/tests/Display.test.js
@@ -14,7 +14,7 @@
///Tasks:
-//1. Add in nessisary imports and values to establish the testing suite.
+//1. Add in necessary imports and values to establish the testing suite.
//2. Test that the Display component renders without any passed in props.
//3. Rebuild or copy a show test data element as used in the previous set of tests.
//4. Test that when the fetch button is pressed, the show component will display. Make sure to account for the api call and change of state in building your test.
diff --git a/src/components/tests/Episode.test.js b/src/components/tests/Episode.test.js
index 448c0563..6d60b907 100644
--- a/src/components/tests/Episode.test.js
+++ b/src/components/tests/Episode.test.js
@@ -23,11 +23,16 @@ const testEpisodeWithoutImage = {
}
test("renders without error", () => {
- render()
+ render()
});
test("renders the summary test passed as prop", ()=>{
- render()
+ render()
+
+ const summary = screen.queryByText(/summary/i)
+
+ expect(summary).toBeInTheDocument();
+ expect(summary).toHaveTextContent(testEpisode.summary)
});
test("renders default image when image is not defined", ()=>{
From 6f01506a7e53078ad64eea9b499d7d9fdbcf1d61 Mon Sep 17 00:00:00 2001
From: Purefallen11 <53922216+Purefallen11@users.noreply.github.com>
Date: Sun, 5 Sep 2021 21:40:25 -0500
Subject: [PATCH 3/3] still not getting the testing
---
src/components/tests/Episode.test.js | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/components/tests/Episode.test.js b/src/components/tests/Episode.test.js
index 6d60b907..cb7c7aeb 100644
--- a/src/components/tests/Episode.test.js
+++ b/src/components/tests/Episode.test.js
@@ -15,7 +15,7 @@ const testEpisode = {
const testEpisodeWithoutImage = {
id: 2,
name: "",
- image: null,
+ image: '',
season: 2,
number: 2,
summary: "",
@@ -28,15 +28,17 @@ test("renders without error", () => {
test("renders the summary test passed as prop", ()=>{
render()
-
- const summary = screen.queryByText(/summary/i)
+ const summary = screen.queryAllByText(testEpisode.summary)
- expect(summary).toBeInTheDocument();
- expect(summary).toHaveTextContent(testEpisode.summary)
+ expect(summary).toBeTruthy()
+
});
test("renders default image when image is not defined", ()=>{
render()
+ const image = screen.queryAllByText(testEpisodeWithoutImage.image)
+
+ expect(image).toBeInTheDocument()
})
//Tasks