Skip to content

Commit

Permalink
fix: updating tests now that react router v6 is part of create-react-app
Browse files Browse the repository at this point in the history
  • Loading branch information
alharris-at committed Nov 4, 2021
1 parent 278b6f8 commit 3c6beed
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
35 changes: 22 additions & 13 deletions packages/test-generator/integration-test-templates/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
import React from 'react';
import { BrowserRouter as Router, Switch, Route } from 'react-router-dom';
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
import ComponentTests from './ComponentTests';
import GenerateTests from './GenerateTests';

const HomePage = () => {
return (
<div>
<h1>Codegen UI Functional Tests</h1>
<ul>
<li>
<a href="/component-tests">Component Tests</a>
</li>
<li>
<a href="/generate-tests">Browser Generation Tests</a>
</li>
</ul>
</div>
);
};

export default function App() {
return (
<Router>
<Switch>
<Route exact path="/">
<div>home</div>
</Route>
<Route path="/component-tests">
<ComponentTests />
</Route>
<Route path="/generate-tests">
<GenerateTests />
</Route>
</Switch>
<Routes>
<Route path="/component-tests" element={<ComponentTests />} />
<Route path="/generate-tests" element={<GenerateTests />} />
<Route path="*" element={<HomePage />} />
</Routes>
</Router>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
import React, { useEffect, useState } from 'react';
import { useEffect, useState } from 'react';
import { AmplifyProvider } from '@aws-amplify/ui-react';
import '@aws-amplify/ui-react/styles.css';
import ViewTest from './ui-components/ViewTest';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
import React from 'react';
import { BrowserTestGenerator } from '@amzn/test-generator';

export default function GenerateTests() {
Expand Down

0 comments on commit 3c6beed

Please sign in to comment.