From 9c42df23e4caeaad720c8845f155e9f672587fd1 Mon Sep 17 00:00:00 2001 From: Dan Gunter Date: Wed, 15 May 2024 21:21:04 -0700 Subject: [PATCH] fix tests --- electron/ui/src/tests/BuildOptions.test.js | 4 ++-- electron/ui/src/tests/Header.test.js | 24 +++++++++++----------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/electron/ui/src/tests/BuildOptions.test.js b/electron/ui/src/tests/BuildOptions.test.js index 703a9fed..7efaf1ae 100644 --- a/electron/ui/src/tests/BuildOptions.test.js +++ b/electron/ui/src/tests/BuildOptions.test.js @@ -1,7 +1,7 @@ import { render, screen } from '@testing-library/react'; import BuildOptions from "../components/BuildOptions/BuildOptions" -import * as React from 'react' -import flowsheetData from './data/BuildOptionsData.json' +import * as React from 'react'; +import flowsheetData from './data/BuildOptionsData.json'; //mock props const setFlowsheetData = () => { diff --git a/electron/ui/src/tests/Header.test.js b/electron/ui/src/tests/Header.test.js index 48ca3bbc..424ebc33 100644 --- a/electron/ui/src/tests/Header.test.js +++ b/electron/ui/src/tests/Header.test.js @@ -1,14 +1,14 @@ import { render, screen } from '@testing-library/react'; -import Header from "../components/Boilerplate/Header/Header" -import * as React from 'react' -import { HashRouter } from "react-router-dom"; - -//mock props - -test('test input accordion', () => { - - render(
) - - //test for component elements - screen.getByRole('img', { name: /NAWI logo/i}); +import { HashRouter } from 'react-router-dom'; +import Header from '../components/Boilerplate/Header/Header'; +import {theme} from '../theme'; + +// Test the header +test('page header', () => { + render(
); + // Test that project name is in the 'alt=' text for the logo image + const projectName = new RegExp(`${theme.project}.*`); + expect(screen.getByAltText(projectName)).toBeDefined(); + // Test that there is a menu button + expect(screen.getByRole('button')).toBeDefined(); }) \ No newline at end of file