Skip to content

Commit f14d0fe

Browse files
❄️ Fix flaky amp-a4a tests (#40049)
1 parent fa1cf9e commit f14d0fe

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

extensions/amp-a4a/0.1/test/test-amp-a4a.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ describes.realWin('amp-a4a', {amp: true}, (env) => {
918918
a4a.onLayoutMeasure();
919919
await a4a.layoutCallback();
920920
verifyCachedContentIframeRender(a4aElement, TEST_URL, true);
921-
expect(a4a.iframe.getAttribute('allow')).to.equal("sync-xhr 'none';");
921+
expect(a4a.iframe.getAttribute('allow')).to.include("sync-xhr 'none';");
922922
});
923923

924924
it('should set feature policy for attribution-reporting when supported', async () => {
@@ -929,8 +929,9 @@ describes.realWin('amp-a4a', {amp: true}, (env) => {
929929
a4a.onLayoutMeasure();
930930
await a4a.layoutCallback();
931931
verifyCachedContentIframeRender(a4aElement, TEST_URL, true);
932-
expect(a4a.iframe.getAttribute('allow')).to.equal(
933-
"sync-xhr 'none';attribution-reporting 'src';"
932+
expect(a4a.iframe.getAttribute('allow')).to.include("sync-xhr 'none';");
933+
expect(a4a.iframe.getAttribute('allow')).to.include(
934+
"attribution-reporting 'src';"
934935
);
935936
});
936937

@@ -942,7 +943,10 @@ describes.realWin('amp-a4a', {amp: true}, (env) => {
942943
a4a.onLayoutMeasure();
943944
await a4a.layoutCallback();
944945
verifyCachedContentIframeRender(a4aElement, TEST_URL, true);
945-
expect(a4a.iframe.getAttribute('allow')).to.equal("sync-xhr 'none';");
946+
expect(a4a.iframe.getAttribute('allow')).to.include("sync-xhr 'none';");
947+
expect(a4a.iframe.getAttribute('allow')).to.not.include(
948+
"attribution-reporting 'src';"
949+
);
946950
});
947951
});
948952

0 commit comments

Comments
 (0)