-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4185 from Codeinwp/feat/mobile_footer_hfg
feat: add mobile support for the footer in HFG
- Loading branch information
Showing
8 changed files
with
96 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"hfg_footer_layout_v2": "{\"desktop\":{\"top\":{\"left\":[],\"c-left\":[],\"center\":[],\"c-right\":[],\"right\":[]},\"main\":{\"left\":[],\"c-left\":[],\"center\":[],\"c-right\":[],\"right\":[]},\"bottom\":{\"left\":[],\"c-left\":[],\"center\":[{\"id\":\"footer_copyright\"}],\"c-right\":[],\"right\":[]}}, \"mobile\":{\"top\":{\"left\":[],\"c-left\":[],\"center\":[{\"id\":\"footer-menu\"}],\"c-right\":[],\"right\":[]},\"main\":{\"left\":[],\"c-left\":[],\"center\":[],\"c-right\":[],\"right\":[]},\"bottom\":{\"left\":[],\"c-left\":[],\"center\":[{\"id\":\"footer_copyright\"}],\"c-right\":[],\"right\":[]}}}", | ||
"nav_menu_locations[footer]": 177 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { test, expect, Page } from '@playwright/test'; | ||
import { setCustomizeSettings } from '../../../utils'; | ||
import data from '../../../fixtures/customizer/hfg/footer-mobile-setup.json'; | ||
|
||
test.describe('Different Footer for Mobile vs Desktop', function () { | ||
test.beforeAll(async ({ browser, request, baseURL }) => { | ||
await browser.newPage(); | ||
await setCustomizeSettings('hfgFooterMobile', data, { | ||
request, | ||
baseURL, | ||
}); | ||
}); | ||
|
||
test('Check Desktop Footer', async ({ page }) => { | ||
await page.goto('/?test_name=hfgFooterMobile'); | ||
|
||
await expect( | ||
page.locator('.hfg_footer .footer--row[data-show-on="desktop"]') | ||
).toHaveText('Neve | Powered by WordPress'); | ||
|
||
await expect( | ||
page.locator( | ||
'.hfg_footer .footer--row[data-show-on="desktop"] .nav-menu-footer' | ||
) | ||
).toHaveCount(0); | ||
|
||
await expect(page.locator('.hfg_footer .nav-menu-footer')).toBeHidden(); | ||
}); | ||
|
||
test('Check Mobile Footer', async ({ page, browser }) => { | ||
const context = await browser.newContext({ | ||
viewport: { width: 600, height: 900 }, | ||
}); | ||
page = await context.newPage(); | ||
await page.goto('/?test_name=hfgFooterMobile'); | ||
|
||
await expect( | ||
page.locator( | ||
'.hfg_footer .footer--row[data-show-on="mobile"] .nav-menu-footer' | ||
) | ||
).toHaveCount(1); | ||
|
||
await expect( | ||
page.locator('.hfg_footer .nav-menu-footer') | ||
).toBeVisible(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters