Removing email prop and fixing test (#11108)

This commit is contained in:
Rafi 2020-10-28 01:08:31 +05:30 committed by GitHub
parent 651f55b331
commit c9014a7835
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View file

@ -1,7 +1,7 @@
import { h } from 'preact';
import PropTypes from 'prop-types';
const ModFaqSection = ({ email, currentMembershipRole }) => {
const ModFaqSection = ({ currentMembershipRole }) => {
if (currentMembershipRole === 'member') {
return null;
}
@ -24,7 +24,6 @@ const ModFaqSection = ({ email, currentMembershipRole }) => {
};
ModFaqSection.propTypes = {
email: PropTypes.string.isRequired,
currentMembershipRole: PropTypes.string.isRequired,
};

View file

@ -5,18 +5,17 @@ import ModFaqSection from '../ChatChannelSettings/ModFaqSection';
describe('<ChannelDescriptionSection />', () => {
it('should have no a11y violations', async () => {
const { container } = render(<ModFaqSection email="jane@doe.com" />);
const { container } = render(<ModFaqSection />);
const results = await axe(container);
expect(results).toHaveNoViolations();
});
it('should render', () => {
const { queryByText } = render(<ModFaqSection email="jane@doe.com" />);
const { queryByText } = render(<ModFaqSection />);
expect(
queryByText(/^Questions about Connect Channel moderation\? Contact/),
).toBeDefined();
expect(queryByText('jane@doe.com')).toBeDefined();
});
});