1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import React from 'react';
6 import { ThemeProvider, StyledEngineProvider } from '@mui/material';
7 import { CustomTheme } from 'common/custom-theme';
8 import { NotFoundPanelRoot } from './not-found-panel-root';
10 describe('NotFoundPanelRoot', () => {
22 SupportEmailAddress: 'support@example.com'
29 it('should render component', () => {
31 const expectedMessage = "The page you requested was not found";
35 <StyledEngineProvider injectFirst>
36 <ThemeProvider theme={CustomTheme}>
37 <NotFoundPanelRoot {...props} />
39 </StyledEngineProvider>
43 cy.get('p').contains(expectedMessage);
46 it('should render component without email url when no email', () => {
48 props.clusterConfig.Users.SupportEmailAddress = '';
52 <StyledEngineProvider injectFirst>
53 <ThemeProvider theme={CustomTheme}>
54 <NotFoundPanelRoot {...props} />
56 </StyledEngineProvider>
60 cy.get('a').should('not.exist');
63 it('should render component with additional message and email url', () => {
65 const hash = '123hash123';
66 const pathname = `/collections/${hash}`;
75 <StyledEngineProvider injectFirst>
76 <ThemeProvider theme={CustomTheme}>
77 <NotFoundPanelRoot {...props} />
79 </StyledEngineProvider>
83 cy.get('p').eq(0).contains(hash);
86 cy.get('a').should('have.length', 1);