mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 22:43:30 +03:00
Fixed errors thrown in tests that were causing random failures
no issue - dropped `id` attribute added to `<GhBenefitItem>` 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
This commit is contained in:
parent
0be1f206a5
commit
7374b0f8c6
@ -138,7 +138,6 @@
|
||||
<DraggableObject @content={{benefitItem}} @dragHandle=".gh-blognav-grab" @isSortable={{true}}>
|
||||
<GhBenefitItem
|
||||
@benefitItem={{benefitItem}}
|
||||
@id={{index}}
|
||||
@addItem={{action "addBenefit"}}
|
||||
@focusItem={{action "focusItem"}}
|
||||
@deleteItem={{action "deleteBenefit"}}
|
||||
|
@ -203,7 +203,7 @@ export default class OffersController extends Controller {
|
||||
if (!this.portalMessageListener) {
|
||||
this.portalMessageListener = (event) => {
|
||||
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`;
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user