From 8c502e615a9817f367b64e529c33f1ca76bc7271 Mon Sep 17 00:00:00 2001 From: rrigato Date: Sun, 19 Nov 2023 08:12:31 -0600 Subject: [PATCH 1/3] formatting so all content appears on screen --- static/css/main.css | 7 +++++-- static/js/HomePageToggle.jsx | 10 +++++++--- static/tests/HomePageToggle.test.js | 3 +++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/static/css/main.css b/static/css/main.css index 715de77..5d97380 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -3,14 +3,18 @@ body, html { color: white; height: 100%; } - +li{ + margin-right: 20px; +} .full-height{ height: 100%; } .homepage-content{ background-color: silver; + border-radius: 5%; color:black; + } .toggle-button{ @@ -42,7 +46,6 @@ body, html { align-items: center; display: flex; flex-direction: column; - height: 80%; justify-content: center; } diff --git a/static/js/HomePageToggle.jsx b/static/js/HomePageToggle.jsx index ce4344b..5bf5436 100644 --- a/static/js/HomePageToggle.jsx +++ b/static/js/HomePageToggle.jsx @@ -83,21 +83,25 @@ export function HomePageToggle(){
  • Application link
  • Source Code
  • -

    Amazon Alexa Air Quality Burning Restriction Skill

    +

    Amazon Alexa Air Quality Caused Fuel Burning Restriction Skill

  • Amazon Alexa skill to determine if a zip code has any fuel burning restrictions for heating your home in the winter.
  • Application link
  • Source Code
  • -

    Web scrap television network ratings

    +

    Web scrapper television network ratings

  • Only location on the internet that has an archive of Adult Swim Toonami Ratings in a programmable format.
  • Reach out to me on github if you would like access.
  • First rule of building a sustainable web scraping application is to never build a web scrapping application.
  • Source Code
  • Github 3d commit history webpage

    -
  • Automates creation of 3D commit history to populate web application artifacts
  • +
  • Automates creation of 3D commit history to populate web application artifacts.
  • Application link
  • Source Code
  • + +

    Markdown to html converter

    +
  • Used to reduce documentation redundancy when hosting markdown documentation
  • +
  • Source Code
  • diff --git a/static/tests/HomePageToggle.test.js b/static/tests/HomePageToggle.test.js index 3ee5462..11facdc 100644 --- a/static/tests/HomePageToggle.test.js +++ b/static/tests/HomePageToggle.test.js @@ -14,6 +14,9 @@ describe('Central Content for site', () => { const projectButton = await getByRole( 'button', {name: 'Projects'} ); + const bookRecommendationsButton = await getByRole( + 'button', {name: 'Book Recommendations'} + ); }); From f0fc7e2e30bdfda967728f20ea724a646b129213 Mon Sep 17 00:00:00 2001 From: rrigato Date: Sun, 19 Nov 2023 08:23:00 -0600 Subject: [PATCH 2/3] extract projects component --- static/js/HomePageToggle.jsx | 28 -------------------- static/js/Projects.jsx | 41 +++++++++++++++++++++++++++++ static/tests/HomePageToggle.test.js | 17 +++++++++--- 3 files changed, 55 insertions(+), 31 deletions(-) create mode 100644 static/js/Projects.jsx diff --git a/static/js/HomePageToggle.jsx b/static/js/HomePageToggle.jsx index 5bf5436..80d2e3c 100644 --- a/static/js/HomePageToggle.jsx +++ b/static/js/HomePageToggle.jsx @@ -76,35 +76,7 @@ export function HomePageToggle(){ hidden= { selectedSection !== 0 }> -
    -
      -

      Amazon Alexa Skill To retrieve Television Ratings

      -
    • Provides television ratings for the Adult Swim Saturday night Toonami television block.
    • -
    • Application link
    • -
    • Source Code
    • -

      Amazon Alexa Air Quality Caused Fuel Burning Restriction Skill

      -
    • Amazon Alexa skill to determine if a zip code has any fuel burning restrictions for heating your home in the winter.
    • -
    • Application link
    • -
    • Source Code
    • - -

      Web scrapper television network ratings

      -
    • Only location on the internet that has an archive of Adult Swim Toonami Ratings in a programmable format.
    • -
    • Reach out to me on github if you would like access.
    • -
    • First rule of building a sustainable web scraping application is to never build a web scrapping application.
    • -
    • Source Code
    • - -

      Github 3d commit history webpage

      -
    • Automates creation of 3D commit history to populate web application artifacts.
    • -
    • Application link
    • -
    • Source Code
    • - -

      Markdown to html converter

      -
    • Used to reduce documentation redundancy when hosting markdown documentation
    • -
    • Source Code
    • -
    - -
    +
      +

      Amazon Alexa Skill To retrieve Television Ratings

      +
    • Provides television ratings for the Adult Swim Saturday night Toonami television block.
    • +
    • Application link
    • +
    • Source Code
    • + +

      Amazon Alexa Air Quality Caused Fuel Burning Restriction Skill

      +
    • Amazon Alexa skill to determine if a zip code has any fuel burning restrictions for heating your home in the winter.
    • +
    • Application link
    • +
    • Source Code
    • + +

      Web scrapper television network ratings

      +
    • Only location on the internet that has an archive of Adult Swim Toonami Ratings in a programmable format.
    • +
    • Reach out to me on github if you would like access.
    • +
    • First rule of building a sustainable web scraping application is to never build a web scrapping application.
    • +
    • Source Code
    • + +

      Github 3d commit history webpage

      +
    • Automates creation of 3D commit history to populate web application artifacts.
    • +
    • Application link
    • +
    • Source Code
    • + +

      Markdown to html converter

      +
    • Used to reduce documentation redundancy when hosting markdown documentation
    • +
    • Source Code
    • +
    + +
    + ); +} \ No newline at end of file diff --git a/static/tests/HomePageToggle.test.js b/static/tests/HomePageToggle.test.js index 11facdc..65eac5e 100644 --- a/static/tests/HomePageToggle.test.js +++ b/static/tests/HomePageToggle.test.js @@ -1,23 +1,34 @@ import { render } from '@testing-library/react'; import { HomePageToggle } from '../js/HomePageToggle.jsx'; +import { Projects } from '../js/Projects.jsx'; + +jest.mock('../js/Projects.jsx'); describe('Central Content for site', () => { + afterEach(() => { + jest.resetAllMocks(); + }); + test('HomePageToggle default render', async () => { + console.log(Projects); + Projects.mockReturnValue(
    mock-projects
    ); + const {getByRole} = render(); - const aboutButton = await getByRole( + getByRole( 'button', {name: 'About'} ); - const projectButton = await getByRole( + getByRole( 'button', {name: 'Projects'} ); - const bookRecommendationsButton = await getByRole( + getByRole( 'button', {name: 'Book Recommendations'} ); + expect(Projects).toHaveBeenCalled() }); }); \ No newline at end of file From 617d4b169ebe8404fdd2a51fdddef37782d3e76b Mon Sep 17 00:00:00 2001 From: rrigato Date: Sun, 19 Nov 2023 08:36:59 -0600 Subject: [PATCH 3/3] Validate number of headers for Projects component --- static/js/HomePageToggle.jsx | 15 ++++++--------- static/tests/HomePageToggle.test.js | 1 - static/tests/Projects.test.js | 23 +++++++++++++++++++++++ 3 files changed, 29 insertions(+), 10 deletions(-) create mode 100644 static/tests/Projects.test.js diff --git a/static/js/HomePageToggle.jsx b/static/js/HomePageToggle.jsx index 80d2e3c..b47005a 100644 --- a/static/js/HomePageToggle.jsx +++ b/static/js/HomePageToggle.jsx @@ -1,5 +1,6 @@ import React, { useState } from 'react'; import '../css/main.css'; +import { Projects } from './Projects.jsx'; /**Toggle button for different sections of homepage @@ -7,7 +8,7 @@ import '../css/main.css'; * @returns react jsx */ export function HomePageToggle(){ - /** + /**Section of the webpage the user wants to view * @type {[Number, Function]} */ const [selectedSection, setSelectedSelection] = useState(0); @@ -70,14 +71,10 @@ export function HomePageToggle(){ - + { + selectedSection === 0 ? : + + }
    { }); test('HomePageToggle default render', async () => { - console.log(Projects); Projects.mockReturnValue(
    mock-projects
    ); diff --git a/static/tests/Projects.test.js b/static/tests/Projects.test.js new file mode 100644 index 0000000..fe32e60 --- /dev/null +++ b/static/tests/Projects.test.js @@ -0,0 +1,23 @@ +import { render } from '@testing-library/react'; +import { Projects } from '../js/Projects.jsx'; + + +describe('Projects displayed on screen', () => { + afterEach(() => { + jest.resetAllMocks(); + }); + + test('Number of project sections', async () => { + + const {getAllByRole} = render(); + + + const numProjectHeaders = getAllByRole( + 'heading' + ); + + + expect(numProjectHeaders.length).toBe(5); + + }); +}); \ No newline at end of file