Skip to content

Commit

Permalink
Merge pull request #4215 from Codeinwp/fix/footer_id
Browse files Browse the repository at this point in the history
fix: footer id unique
  • Loading branch information
preda-bogdan authored Mar 28, 2024
2 parents 977af2f + e59ee0e commit 99d64ea
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions e2e-tests/specs/customizer/hfg/hfg-footer-mobile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,16 @@ test.describe('Different Footer for Mobile vs Desktop', function () {
page.locator('.hfg_footer .nav-menu-footer')
).toBeVisible();
});

test('Check IDs are unique', async ({ page }) => {
await page.goto('/?test_name=hfgFooterMobile');

await expect(page.locator('#cb-row--footer-bottom')).toHaveCount(0);
await expect(
page.locator('#cb-row--footer-desktop-bottom')
).toHaveCount(1);
await expect(page.locator('#cb-row--footer-mobile-bottom')).toHaveCount(
1
);
});
});
2 changes: 1 addition & 1 deletion header-footer-grid/templates/footer-row-wrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
$row_wrapper_classes = join( ' ', $row_wrapper_classes );
?>
<div class="<?php echo esc_attr( join( ' ', $row_classes ) ); ?>"
id="cb-row--footer-<?php echo esc_attr( $row_index ); ?>"
id="cb-row--footer-<?php echo esc_attr( $device ); ?>-<?php echo esc_attr( $row_index ); ?>"
data-row-id="<?php echo esc_attr( $row_index ); ?>" data-show-on="<?php echo esc_attr( $device ); ?>">
<div
class="footer--row-inner footer-<?php echo esc_attr( $row_index ); ?>-inner footer-content-wrap">
Expand Down

0 comments on commit 99d64ea

Please sign in to comment.