mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-29 22:01:49 +03:00
Revert "Changed request type to fetching iframe content in previews
refs https://ghost.slack.com/archives/C0568LN2CGJ/p1706018058495729
This commit is contained in:
parent
109a354818
commit
181be4ef1b
@ -224,7 +224,7 @@ export async function mockSitePreview({page, url, response}: {page: Page, url: s
|
||||
const lastRequest: {previewHeader?: string} = {};
|
||||
|
||||
await page.route(url, async (route) => {
|
||||
if (route.request().method() !== 'GET') {
|
||||
if (route.request().method() !== 'POST') {
|
||||
return route.continue();
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ const AnnouncementBarPreview: React.FC<AnnouncementBarSettings> = ({announcement
|
||||
}
|
||||
|
||||
fetch(url, {
|
||||
method: 'GET',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'text/html;charset=utf-8',
|
||||
'x-ghost-preview': getPreviewData(
|
||||
|
@ -65,7 +65,7 @@ const ThemePreview: React.FC<ThemePreviewProps> = ({settings,url}) => {
|
||||
|
||||
// Fetch theme preview HTML
|
||||
fetch(url, {
|
||||
method: 'GET',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'text/html;charset=utf-8',
|
||||
'x-ghost-preview': previewData,
|
||||
|
@ -44,7 +44,7 @@ test.describe('Announcement Bar', async () => {
|
||||
|
||||
const iframesHandleHome = await page.$$('[data-testid="announcement-bar-preview-iframe"] > iframe');
|
||||
const textExistsInHomeIframes = await checkTextInIframes(iframesHandleHome, 'homepage preview');
|
||||
await expect(textExistsInHomeIframes).toBeTruthy();
|
||||
expect(textExistsInHomeIframes).toBeTruthy();
|
||||
|
||||
const modal = page.getByTestId('announcement-bar-modal');
|
||||
await modal.getByTestId('design-toolbar').getByRole('tab', {name: 'Post'}).click();
|
||||
|
@ -220,7 +220,7 @@ test.describe('Design settings', async () => {
|
||||
await expect(modal.getByTestId('design-setting-tabs').getByRole('tab', {name: 'Post'})).toBeHidden();
|
||||
|
||||
const expectedEncoded = new URLSearchParams([['custom', JSON.stringify({})]]).toString();
|
||||
await expect(lastPreviewRequest.previewHeader).toMatch(new RegExp(`&${expectedEncoded.replace(/\+/g, '\\+')}`));
|
||||
expect(lastPreviewRequest.previewHeader).toMatch(new RegExp(`&${expectedEncoded.replace(/\+/g, '\\+')}`));
|
||||
});
|
||||
|
||||
test('Custom theme setting visibility', async ({page}) => {
|
||||
|
Loading…
Reference in New Issue
Block a user