From 7374b0f8c696952f92e7fe8b59839b5520f46feb Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Mon, 14 Mar 2022 10:28:58 +0000 Subject: [PATCH] Fixed errors thrown in tests that were causing random failures no issue - dropped `id` attribute added to `` because it was only using the index resulting in multiple `id="1"` on the page which is invalid HTML and caused Glimmer to complain - added a check for `portalPreviewIframe` existence when the portal message listener in the offer controller is fired because it was occurring out of sync with the tests and throwing async errors that were picked up in random later tests --- ghost/admin/app/components/modal-product.hbs | 1 - ghost/admin/app/controllers/offer.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ghost/admin/app/components/modal-product.hbs b/ghost/admin/app/components/modal-product.hbs index 8b5a3c30f2..26596b12e3 100644 --- a/ghost/admin/app/components/modal-product.hbs +++ b/ghost/admin/app/components/modal-product.hbs @@ -138,7 +138,6 @@ { const resizeEvents = ['portal-ready', 'portal-preview-updated']; - if (resizeEvents.includes(event.data.type) && event.data.payload?.height && this.portalPreviewIframe.parentNode) { + if (resizeEvents.includes(event.data.type) && event.data.payload?.height && this.portalPreviewIframe?.parentNode) { this.portalPreviewIframe.parentNode.style.height = `${event.data.payload.height}px`; } };