Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
2b5f14c
Require Hello World in the document
acbart Jan 31, 2022
a7dee05
Rename text.Test.tsx to text.test.tsx
acbart Jan 31, 2022
3e381f3
Include the task info
acbart Jan 31, 2022
fee03d3
Merge branch 'task-first-branch' of https://github.com/UD-CISC275-S22…
acbart Jan 31, 2022
e6b1dab
Allow one or more instances of the Hello World text
acbart Feb 3, 2022
7a20734
Include json test command here
acbart Aug 24, 2024
7fe9ca3
Require Hello World in the document
acbart Jan 31, 2022
b8b8878
Include the task info
acbart Jan 31, 2022
fbdebde
Rename text.Test.tsx to text.test.tsx
acbart Jan 31, 2022
2f0146c
Allow one or more instances of the Hello World text
acbart Feb 3, 2022
a6acb43
Merge branch 'task-first-branch' of https://github.com/frontend-fun/t…
acbart Aug 24, 2024
ac36b32
First set of tests
acbart Jan 30, 2022
d04739d
Some logging tests
acbart Jan 30, 2022
b26100f
More html tests
acbart Jan 30, 2022
3bf4550
Fix the image test
acbart Jan 30, 2022
8dff2b6
Updated CSS tests, left a note about additional tests
acbart Jan 31, 2022
b66d4de
See previous commit message
acbart Jan 31, 2022
0a24364
Add in new css test
acbart Aug 24, 2024
4d43d7a
Add in points
acbart Aug 24, 2024
83c4461
Basic functions tests and stubs
acbart Jan 30, 2022
a486530
Fix test organization
acbart Jan 30, 2022
9722564
Fix issue in fahrenheit conversion
acbart Jan 30, 2022
bd06d5d
Move around some of the functions
acbart Feb 3, 2022
4cd1900
Explain what the actual functions require you to do
acbart Feb 3, 2022
cf1d21a
Update formatting
acbart Aug 24, 2024
e11693a
Add in points
acbart Aug 24, 2024
7cc4e3f
First stab at array problems
acbart Feb 1, 2022
f253337
Add in the rest of the tests
acbart Feb 1, 2022
b8777b1
Fix question text
acbart Feb 1, 2022
f87771e
Update arrays.test.ts
acbart Feb 11, 2022
f0d316b
Add in points
acbart Aug 24, 2024
c2e556d
First stab at questions
acbart Feb 2, 2022
406ffb2
Move Question interface to separate file
acbart Feb 6, 2022
9b9adb6
Fix formatting
acbart Aug 24, 2024
3660252
First stab at questions
acbart Feb 2, 2022
09d3d4f
Move Question interface to separate file
acbart Feb 6, 2022
9a24024
Create answer interface
acbart Feb 8, 2022
879fe17
First stab at nested tasks
acbart Feb 8, 2022
4d29d21
Document Question interface
acbart Feb 9, 2022
d71d9fc
Expand questions test data
acbart Feb 9, 2022
c955718
Add a little hint for a tough one
acbart Feb 9, 2022
c574699
Nested tests (phew)
acbart Feb 9, 2022
a368ad0
Forgot the task record!
acbart Feb 19, 2022
304184e
Fix typo in editOption test, and missing return type for editOption
acbart Mar 1, 2022
1b76b80
Fix formatting
acbart Aug 24, 2024
67edb6d
Merge branch 'main' into task-nested
greglnelson Sep 8, 2024
5a7921b
Merge branch 'main' into task-objects
greglnelson Sep 8, 2024
80f1cf6
Update HtmlCss.test.tsx
greglnelson Sep 17, 2024
974fb09
Merge so 2024 works
greglnelson Oct 17, 2024
ae19e0f
reduced workload by half
greglnelson Oct 17, 2024
56c25c8
Added name to App
CoderBren Sep 7, 2025
da5208b
Added Hello World and Brendon to App.tsx
CoderBren Sep 7, 2025
929bda1
Updated build and resolved caniuse-lite warning
CoderBren Sep 7, 2025
749ebfa
Fixed App.tsx and resolved all code errors
CoderBren Sep 7, 2025
6c8cca1
Merge remote-tracking branch 'upstream/task-html-css' into solved-htm…
brendonprice Sep 12, 2025
6b0b7b6
Merge remote-tracking branch 'upstream/task-functions' into solved-fu…
brendonprice Sep 14, 2025
30d7444
Commit for part 2 of assignment
brendonprice Sep 14, 2025
3f921ab
Commiting for chapter 2 part 1
brendonprice Sep 14, 2025
fa97054
Merge pull request #1 from brendonprice/solved-html-css
brendonprice Sep 14, 2025
ed5f957
Merge remote-tracking branch 'upstream/task-arrays' into solved-arrays
brendonprice Sep 16, 2025
ae61773
Commit for chapter 3 arrays
brendonprice Sep 16, 2025
17197ed
Merge pull request #2 from brendonprice/solved-arrays
brendonprice Sep 16, 2025
1823c5c
Merge remote-tracking branch 'upstream/task-objects' into solved-objects
brendonprice Sep 16, 2025
79a90ec
Commit for objects task of textbook project
brendonprice Sep 16, 2025
30c2194
Merge pull request #3 from brendonprice/solved-objects
brendonprice Sep 16, 2025
b917ee8
Merge remote-tracking branch 'upstream/task-nested' into solved-nested
brendonprice Sep 16, 2025
e289f9a
Commiting changes for the final part as well as a quick update to obj…
brendonprice Sep 17, 2025
0425fd5
Merge pull request #4 from brendonprice/solved-nested
brendonprice Sep 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 60 additions & 69 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"build": "react-scripts build",
"test": "react-scripts test",
"test:cov": "react-scripts test --coverage --watchAll",
"test:json": "react-scripts test --json --watchAll=false --outputFile jest-output.json --coverage",
"eject": "react-scripts eject",
"lint": "eslint ./src --ext .tsx --ext .ts --max-warnings 0",
"eslint-output": "eslint-output ./src --ext .tsx --ext .ts --max-warnings 0",
Expand Down
5 changes: 5 additions & 0 deletions public/tasks/task-arrays.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Task - Arrays

Version: 0.0.1

Implement functions that work with arrays immutably.
5 changes: 5 additions & 0 deletions public/tasks/task-first-branch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Task - First Branch

Version: 0.0.1

Pass a short test to have certain text on the page.
5 changes: 5 additions & 0 deletions public/tasks/task-functions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Task - Functions

Version: 0.0.1

Implement a bunch of functions that work on primitives.
5 changes: 5 additions & 0 deletions public/tasks/task-html-css.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Task - HTML/CSS

Version: 0.0.1

Add in some HTML and CSS, including a fancy looking button.
5 changes: 5 additions & 0 deletions public/tasks/task-nested.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Task - Nested

Version: 0.0.1

Implement functions that work with nested arrays and objects immutably.
5 changes: 5 additions & 0 deletions public/tasks/task-objects.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Task - Objects

Version: 0.0.1

Implement functions that work with objects immutably.
Binary file added src/102_0371.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

.App-header {
width: 100%;
background-color: #282c34;
background-color: rgb(50, 205, 50);
min-height: 40vh;
display: flex;
flex-direction: column;
Expand Down
2 changes: 1 addition & 1 deletion src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ test("renders the course name somewhere", () => {
render(<App />);
const linkElement = screen.getByText(/COS420/i);
expect(linkElement).toBeInTheDocument();
});
});
65 changes: 64 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,79 @@
import React from "react";
import "./App.css";
import { Button } from "react-bootstrap";

function App(): React.JSX.Element {
return (
<div className="App">
<header className="App-header">
UM COS420 with React Hooks and TypeScript
<h1>UM COS420 with React Hooks and TypeScript</h1>
</header>
<p>
Edit <code>src/App.tsx</code> and save. This page will
automatically reload.
</p>
Hello World
<p>Created by Brendon</p>


{/* Step 2: Add image with alt text*/}
<h1>Check this picture out:</h1>
<img
src="C:\Users\brend\tasks\102_0371.jpeg"
alt="A picture of my girlfriend and I"
/>



{/* Step 3: Add a list of 3 items*/}
<ul>
<li>Computer</li>
<li>Github</li>
<li>Discord</li>
</ul>



{/* Step 4: Change the background color of the header area */}
{/* Changed to vibrant green in the App.css file */}




{/* Step 5: Add a bootstrap button with the text Log Hello World */}
{/* Make the button log Hello World! when clicked */}

<Button onClick={ () => { console.log("Hello World!") } }>Log Hello World</Button>



{/* Step 6: Put a red-filled rectangle in each column using a div tag with width, height, and backgroundColor styles */}

return (
<div style={{ display: "flex", gap: "10px" }}>
<div
style={{
width: "100px",
height: "100px",
backgroundColor: "red",
}}
></div>
<div
style={{
width: "100px",
height: "100px",
backgroundColor: "red",
}}
></div>
<div
style={{
width: "100px",
height: "100px",
backgroundColor: "red",
}}
></div>
</div>
);
</div>
);
}
Expand Down
83 changes: 83 additions & 0 deletions src/HtmlCss.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import React from "react";
import { render, screen } from "@testing-library/react";
import App from "./App";
import userEvent from "@testing-library/user-event";

describe("Some HTML Elements are added.", () => {
test("(2 pts) There is a heading", () => {
render(<App />);
const heading = screen.getAllByRole("heading");
expect(heading[0]).toBeInTheDocument();
});

test("(2 pts) There is an image with alt text", () => {
render(<App />);
const image = screen.getByRole("img");
expect(image).toBeInTheDocument();
expect(image).toHaveAttribute("alt");
});

test("(2 pts) There is a list with at least three elements", () => {
render(<App />);
const list = screen.getByRole("list");
expect(list).toBeInTheDocument();
expect(list.children.length).toBeGreaterThanOrEqual(3);
});
});

describe("(2 pts) Some basic CSS is added.", () => {
test("The background color of the header area is different", () => {
render(<App />);
const banner = screen.getByRole("banner");
expect(banner).not.toHaveStyle({
"background-color": "rgb(40, 44, 52)",
});
});
});

describe("(2 pts) Some Bootstrap Elements are added", () => {
test("There is one bootstrap button with the text 'Log Hello World'", () => {
render(<App />);
const button = screen.getByRole("button", { name: /Log Hello World/i });
expect(button).toBeInTheDocument();
expect(button).toHaveClass("btn");
expect(button).toHaveClass("btn-primary");
});

test("(2 pts) Not clicking the bootstrap button does not logs 'Hello World!'", () => {
const consoleSpy = jest.spyOn(console, "log");
render(<App />);
expect(consoleSpy).not.toHaveBeenCalledWith("Hello World!");
});

test("(2 pts) Clicking the bootstrap button logs 'Hello World!'", () => {
const consoleSpy = jest.spyOn(console, "log");
render(<App />);
const button = screen.getByRole("button", { name: /Log Hello World/i });
userEvent.click(button);
expect(consoleSpy).toHaveBeenCalledWith("Hello World!");
});
});

describe("Some additional CSS was added", () => {
test("(2 pts) checks if any element has a background color of red", () => {
const { container } = render(<App />);
// Get all elements in the rendered container
const elements = container.querySelectorAll("*");

// Check if any element has a background color of red
let foundRedBackground = false;

elements.forEach((element) => {
const style = getComputedStyle(element);
if (
style.backgroundColor === "red" ||
style.backgroundColor === "rgb(255, 0, 0)"
) {
foundRedBackground = true;
}
});

expect(foundRedBackground).toBe(true);
});
});
Loading