Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dangunter committed May 16, 2024
1 parent de9b0a6 commit 9c42df2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions electron/ui/src/tests/BuildOptions.test.js
Original file line number Diff line number Diff line change
@@ -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 = () => {
Expand Down
24 changes: 12 additions & 12 deletions electron/ui/src/tests/Header.test.js
Original file line number Diff line number Diff line change
@@ -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( <HashRouter><Header show={true}></Header></HashRouter> )

//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( <HashRouter><Header show={true}></Header></HashRouter> );
// 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();
})

0 comments on commit 9c42df2

Please sign in to comment.