bldg14 / eventual

A simple event calendar
https://eventual-client.fly.dev
MIT License
0 stars 0 forks source link

Heading Component #9

Closed eduenez33 closed 1 year ago

eduenez33 commented 1 year ago

Overview

Created directory eventual/src/heading with the file eventual/src/heading/heading.tsx which holds the Heading component that takes a prop of title as a type of string. The Heading component is then used in eventual/src/App.tsx that takes a hardcoded title prop. resolves #6

Thought Process

At first I wrote the Heading component as it was taught here and it looked like function Heading({title}: {title: string;}) {return (<h1> { title } </h1>);} I tested if a simple arrow function would work and it did and left it like that as it was less lines

I decided to the take the prop typing and put them in an interface so it looks cleaner

Testing Steps

Risks

Title prop is NOT optional and has to be specified. Has to be a type of string

kevinfalting commented 1 year ago

Hey, I noticed that you removed the test file and there are no tests for the Heading component, can you add some?

eduenez33 commented 1 year ago

Hey @kevinfalting, am I just recovering the test file that I removed or making a new test for the heading component?

kevinfalting commented 1 year ago

Whatever you think would be best. I might start by using what was there, and potentially end up with something entirely different. Writing unit tests can be hard to wrap your head around, so it's something we can focus on when we meet again. 👌