blob: 188a26e0a58874b7d17fe689ad906b63ad6a97dc [file] [log] [blame]
lapentafd360b7a32022-03-08 09:25:43 +00001/*-
2 * ============LICENSE_START=======================================================
3 * ONAP CLAMP
4 * ================================================================================
5 * Copyright (C) 2022 Nordix Foundation. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END============================================
19 * ===================================================================
20 *
21 */
22
23import React from "react";
24import ReactDOM from "react-dom";
25import { Route, MemoryRouter } from 'react-router-dom'
26import OnapClamp from './OnapClamp';
27
28
29
30const routing = (
31 <MemoryRouter forceRefresh={ false }>
32 <Route path="/" component={ OnapClamp }/>
33 </MemoryRouter>
34);
35jest.mock("react-dom", () => ({ render: jest.fn() }));
36
37describe("Application root", () => {
38 it("should render without crashing", () => {
39 const div = document.createElement("div");
40 div.id = "root";
41 document.body.appendChild(div);
42 require("./index.js");
43 expect(ReactDOM.render).toHaveBeenCalledWith(routing, div);
44 });
45});