Skip to content

Commit

Permalink
Merge pull request #10 from rrigato/dev
Browse files Browse the repository at this point in the history
HomePageToggle Component
  • Loading branch information
rrigato authored Nov 11, 2023
2 parents 5849c8b + 6d13ec1 commit ccf1489
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 19 deletions.
8 changes: 0 additions & 8 deletions static/App.jsx

This file was deleted.

9 changes: 3 additions & 6 deletions static/css/main.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
background {
color: black;
}

text {
body {
background-color: black;
color: white;
}
}
2 changes: 1 addition & 1 deletion static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<title>Homepage</title>
<title>Ryan Rigato Homepage</title>
</head>

<body>
Expand Down
11 changes: 11 additions & 0 deletions static/js/App.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';
import '../css/main.css';
import { HomePageToggle } from './HomePageToggle';

export function App(){
return(
<div id='app-entry-point'>
<HomePageToggle/>
</div>
);
}
12 changes: 12 additions & 0 deletions static/js/HomePageToggle.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';
import '../css/main.css';

export function HomePageToggle(){
return(
<div id='home-page-toggle-component' className='toggle-container'>
<div id='toggle-0'>
Latest Projects
</div>
</div>
);
}
2 changes: 1 addition & 1 deletion static/js/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { createRoot } from 'react-dom/client';
import { App } from '../App.jsx';
import { App } from './App.jsx';



Expand Down
13 changes: 10 additions & 3 deletions static/tests/App.test.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
import { render } from '@testing-library/react';
import {App} from '../App.jsx';
import { App } from '../js/App.jsx';
import { HomePageToggle } from '../js/HomePageToggle.jsx';

jest.mock('../js/HomePageToggle.jsx');

describe('entry point for app', () => {

afterEach(() => {
jest.resetAllMocks();
});

test('HomePageToggle called', () => {


const renderedHomepage = render(<App/>);


renderedHomepage.findByText('react initial setup');
expect(HomePageToggle).toHaveBeenCalled();

});
});
14 changes: 14 additions & 0 deletions static/tests/HomePageToggle.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { render } from '@testing-library/react';
import { HomePageToggle } from '../js/HomePageToggle.jsx';

describe('Central Content for site', () => {
test('HomePageToggle default render', () => {


const {findByText} = render(<HomePageToggle/>);


findByText(RegExp('Latest Projects'));

});
});

0 comments on commit ccf1489

Please sign in to comment.