Skip to content

Commit

Permalink
added proptype to fix sonar cloud warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Yasintrm committed Nov 11, 2023
1 parent 5c8f517 commit 9a60049
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/components/Panel/Panel.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import Panel from './index';
import PropTypes from "prop-types";

function Component(props) {
return (
Expand All @@ -16,6 +17,15 @@ function Component(props) {
);
}

Component.propTypes = {
children: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.node),
PropTypes.node,
PropTypes.element,
PropTypes.string,
]),
};

describe('Panel', () => {
const cssClasses = {
panel: 'tyk-panel',
Expand Down Expand Up @@ -167,13 +177,13 @@ describe('Panel', () => {
.should('have.class', cssClasses.theme.success);
});

it('should call set theme to success with theme="danger"', () => {
it('should call set theme to danger with theme="danger"', () => {
cy.mount(<Component theme="danger" />)
.get(selectors.panel)
.should('have.class', cssClasses.theme.danger);
});

it('should call set theme to success with theme="warning"', () => {
it('should call set theme to warning with theme="warning"', () => {
cy.mount(<Component theme="warning" />)
.get(selectors.panel)
.should('have.class', cssClasses.theme.warning);
Expand Down

0 comments on commit 9a60049

Please sign in to comment.