diff --git a/jest.config.js b/jest.config.js index 39fc0af80..8ed13af42 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,5 +1,10 @@ /** @type {import('ts-jest').JestConfigWithTsJest} */ module.exports = { + moduleNameMapper: { + "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": + "/tests/__mocks__/fileMock.js", + "\\.(css|less)$": "/tests/__mocks__/styleMock.js", + }, preset: "ts-jest", testEnvironment: "jsdom", testEnvironmentOptions: { diff --git a/src/components/Header.tsx b/src/components/Header.tsx index b5d14d3df..5f5a6ae68 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -29,6 +29,7 @@ export interface HeaderDispatchProps { export interface HeaderOwnProps { store?: Store; + logoOnly?: boolean; } export interface HeaderProps @@ -130,83 +131,90 @@ export class Header extends React.Component { }, ]; const accountLink = { label: "Change password", href: "account/" }; + const logoOnly = this.props.logoOnly ?? false; return ( {title()} - {this.props.libraries && this.props.libraries.length > 0 && ( - - {(!this.context.library || !currentLibrary) && ( - - )} - {this.props.libraries.map((library) => ( - - ))} - + {(!this.context.library || !currentLibrary) && ( + + )} + {this.props.libraries.map((library) => ( + + ))} + + )} + + )} - - - {currentLibrary && ( -