Show tag dropdown for Sidebar Right (Individual Post) location (#18779)
This commit is contained in:
parent
62fbb2f5fe
commit
24cf767c9c
2 changed files with 12 additions and 4 deletions
|
|
@ -81,13 +81,13 @@ function defaultTagValues() {
|
|||
*/
|
||||
document.ready.then(() => {
|
||||
const select = document.getElementsByClassName('js-placement-area')[0];
|
||||
|
||||
if (select.value === 'post_comments') {
|
||||
const placementAreasWithTags = ['post_comments', 'post_sidebar']
|
||||
if (placementAreasWithTags.includes(select.value)) {
|
||||
showTagsField();
|
||||
}
|
||||
|
||||
select.addEventListener('change', (event) => {
|
||||
if (event.target.value === 'post_comments') {
|
||||
if (placementAreasWithTags.includes(event.target.value)) {
|
||||
showTagsField();
|
||||
} else {
|
||||
hideTagsField();
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ describe('Create Display Ads', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it('should not show the tags field if the placement is not "Below the comment section"', () => {
|
||||
it('should not show the tags field if the placement is not one of the post page areas', () => {
|
||||
cy.findByRole('combobox', { name: 'Placement Area:' }).select(
|
||||
'Sidebar Right (Home)',
|
||||
);
|
||||
|
|
@ -25,5 +25,13 @@ describe('Create Display Ads', () => {
|
|||
);
|
||||
cy.findByLabelText('Targeted Tag(s)').should('exist');
|
||||
});
|
||||
|
||||
it('should show the tags field if the placement is "Sidebar Right (Individual Post)"', () => {
|
||||
cy.findByRole('combobox', { name: 'Placement Area:' }).select(
|
||||
'Sidebar Right (Individual Post)',
|
||||
);
|
||||
cy.findByLabelText('Targeted Tag(s)').should('exist');
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue