dont show rules for top tags (#14878)

This commit is contained in:
Suzanne Aitchison 2021-10-01 21:16:00 +01:00 committed by GitHub
parent f91984d21b
commit b0b2b995c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 11 deletions

View file

@ -419,13 +419,15 @@ export class Tags extends Component {
) : (
''
)}
<div
className={`${classPrefix}__tagrules--${
showingRulesForTag === tag.name ? 'active' : 'inactive'
}`}
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{ __html: tag.rules_html }}
/>
{!showingTopTags && (
<div
className={`${classPrefix}__tagrules--${
showingRulesForTag === tag.name ? 'active' : 'inactive'
}`}
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{ __html: tag.rules_html }}
/>
)}
</div>
));
if (

View file

@ -23,7 +23,7 @@ describe('Add tags to article', () => {
cy.findByRole('button', { name: 'tagone' }).should('exist');
cy.findByRole('button', {
name: 'tagtwo Here are some rules link here',
name: 'tagtwo',
}).should('exist');
});
@ -34,14 +34,14 @@ describe('Add tags to article', () => {
// Search is in progress, top tags which don't match shouldn't be shown
cy.findByRole('button', { name: 'tagone' }).should('not.exist');
cy.findByRole('button', {
name: 'tagtwo Here are some rules link here',
name: 'tagtwo',
}).should('not.exist');
// Users initiating fresh search after comma
cy.findByRole('textbox', { name: 'Post Tags' }).focus();
cy.findByRole('button', { name: 'tagone' }).should('exist');
cy.findByRole('button', {
name: 'tagtwo Here are some rules link here',
name: 'tagtwo',
}).should('exist');
});
@ -52,7 +52,7 @@ describe('Add tags to article', () => {
cy.findByRole('button', { name: 'tagone' }).should('not.exist');
cy.findByRole('button', {
name: 'tagtwo Here are some rules link here',
name: 'tagtwo',
}).should('exist');
});
});