Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
2689d02
Started moving page attachment
mszylkowski Dec 21, 2021
32e6bd5
Create bundle
mszylkowski Dec 21, 2021
778f895
Fixed tests
mszylkowski Dec 21, 2021
fd82574
Fixed import
mszylkowski Dec 21, 2021
6c023bb
Not use service getters to avoid bundling
mszylkowski Dec 21, 2021
1b372e9
Fix services
mszylkowski Dec 21, 2021
fbe589c
Fix shopping unit test
mszylkowski Dec 22, 2021
b2323ff
Removed dependency on localizationservice
mszylkowski Dec 22, 2021
6458e97
Fixed localization
mszylkowski Dec 22, 2021
68303bc
Fixed tests
mszylkowski Dec 22, 2021
d40ea05
Merge branch 'main' of github.com:ampproject/amphtml into removeAttac…
mszylkowski Dec 22, 2021
bc5942e
Sync service fetchers
mszylkowski Dec 22, 2021
fe949a0
Made services sync
mszylkowski Dec 23, 2021
65fafaa
Fixed tests for sync services
mszylkowski Dec 23, 2021
1cabd29
Remove unused import in test
mszylkowski Dec 23, 2021
a766496
AnalyticsService to sync
mszylkowski Dec 23, 2021
204c4ee
Import devAssert
mszylkowski Dec 23, 2021
d4cc178
Remove param to buildInline
mszylkowski Dec 23, 2021
35e1aab
Undo describes.js
mszylkowski Dec 23, 2021
f9cb0d7
Fix tests
mszylkowski Dec 23, 2021
bcbac30
Remove unused import
mszylkowski Dec 23, 2021
b8f903e
Debundle store with forms
mszylkowski Dec 23, 2021
7b39379
Merge branch 'main' of github.com:ampproject/amphtml into removeAttac…
mszylkowski Dec 23, 2021
e429bf4
Moved open-page-attachment
mszylkowski Dec 23, 2021
897e178
Merge branch 'main' of github.com:ampproject/amphtml into tryRemoveAt…
mszylkowski Dec 28, 2021
57b6b23
Hooked up active attribute
mszylkowski Dec 28, 2021
02b5ecb
Fixed page attachment parent element
mszylkowski Dec 28, 2021
29a58a7
Fix opening attachment
mszylkowski Dec 28, 2021
a745d50
Fixing tests
mszylkowski Dec 28, 2021
720b89e
Removed unused tests
mszylkowski Dec 28, 2021
07075f8
Fixed amp-story test
mszylkowski Dec 28, 2021
0272bc5
Dep-check
mszylkowski Dec 28, 2021
8b6599c
Zindex fix
mszylkowski Dec 28, 2021
48e514d
Moved scrim styles to page-attachment
mszylkowski Jan 4, 2022
3a0bd28
Fixed zindex
mszylkowski Jan 5, 2022
6b89a91
Merge branch 'main' of github.com:ampproject/amphtml into tryRemoveAt…
mszylkowski Jan 11, 2022
548a923
Merge branch 'main' of github.com:ampproject/amphtml into tryRemoveAt…
mszylkowski Jan 12, 2022
8d00119
Removed unused import
mszylkowski Jan 12, 2022
1c3dc84
Fixed duplicate imports in test
mszylkowski Jan 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed tests
  • Loading branch information
mszylkowski committed Dec 22, 2021
commit 68303bc27fd3e4783d851d332712793f7cc81ef2
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class AmpStoryPageAttachment extends DraggableDrawer {
* @override
*/
buildCallback() {
super.buildCallback().then(() => {
return super.buildCallback().then(() => {
this.maybeSetDarkThemeForElement_(this.headerEl);
this.maybeSetDarkThemeForElement_(this.element);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import {Services} from '#service';
import {AmpDocSingle} from '#service/ampdoc-impl';
import {LocalizationService} from '#service/localization';

import {AmpStoryPageAttachment} from '../amp-story-page-attachment';

Expand All @@ -16,6 +18,11 @@ describes.realWin('amp-story-page-attachment', {amp: true}, (env) => {
storyEl.getAmpDoc = () => new AmpDocSingle(win);
win.document.body.appendChild(storyEl);

const localizationService = new LocalizationService(win.document.body);
env.sandbox
.stub(Services, 'localizationServiceForOrNull')
.returns(Promise.resolve(localizationService));

// Set up the attachment element for inline attachment testing.
attachmentEl = win.document.createElement('amp-story-page-attachment');
attachmentEl.getAmpDoc = () => new AmpDocSingle(win);
Expand All @@ -36,20 +43,20 @@ describes.realWin('amp-story-page-attachment', {amp: true}, (env) => {
});

it('should build an attachment', async () => {
attachment.buildCallback();
await attachment.buildCallback();
return attachment.layoutCallback();
});

it('should build an outlink', async () => {
outlink.buildCallback();
await outlink.buildCallback();
return outlink.layoutCallback();
});

it('should build amp-story-page-outlink with target="_top" even when the publisher has specified a different value', async () => {
const anchorEl = outlinkEl.querySelector('amp-story-page-outlink a');
anchorEl.setAttribute('target', '_blank');

outlink.buildCallback();
await outlink.buildCallback();
await outlink.layoutCallback();

expect(anchorEl.getAttribute('target')).to.eql('_top');
Expand Down