Skip to content

Commit

Permalink
Add test for cache page
Browse files Browse the repository at this point in the history
  • Loading branch information
ligangty committed Jan 2, 2024
1 parent 3945d3c commit 010d800
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/main/webui/src/app/components/content/addons/Cache.test.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* Copyright (C) 2023 Red Hat, Inc. (https://github.com/Commonjava/indy-ui-service)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import React from "react";
import {render, screen, cleanup} from '@testing-library/react';
import '@testing-library/jest-dom';
import fetchMock from "fetch-mock";
import Cache from "./Cache.jsx";

beforeEach(()=>{
fetchMock.restore();
});

afterEach(() => {
cleanup();
});

describe('RemoteList tests', () => {
it("Verify Cache", ()=>{
render(<Cache />);
expect(screen.getByRole("textbox", {Name: "Input the the metadata url"})).toBeInTheDocument();
expect(screen.getByRole("button", {Name: "Delete"})).toBeInTheDocument();
});
});

0 comments on commit 010d800

Please sign in to comment.