import React from 'react';
import { render } from '@testing-library/react';
<% if (routing) { %>
import { BrowserRouter } from 'react-router-dom';
<% } %>

import App from './app';

describe('App', () => {
  it('should render successfully', () => {
    <% if (routing) { %>
    const { baseElement } = render(<BrowserRouter><App /></BrowserRouter>);
    <% } else { %>
    const { baseElement } = render(<App />);
    <% } %>
    expect(baseElement).toBeTruthy();
  });

  it('should have a greeting as the title', () => {
    <% if (routing) { %>
    const { getByText } = render(<BrowserRouter><App /></BrowserRouter>);
    <% } else { %>
    const { getByText } = render(<App />);
    <% } %>
    expect(getByText('Welcome to <%= projectName %>!')).toBeTruthy();
  });
});
