Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #3374 from bbc/6143-add-AMP-ad-script-to-boilerplate
Browse files Browse the repository at this point in the history
Add amp ad script to boilerplate
  • Loading branch information
amywalkerdev authored Apr 14, 2020
2 parents 81401fe + 5a56d76 commit 69345c9
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/utilities/psammead-assets/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- prettier-ignore -->
| Version | Description |
|---------|-------------|
| 2.14.0 | [PR#3374](https://github.com/bbc/psammead/pull/3374) Add AMP_AD script |
| 2.13.0 | [PR#3020](https://github.com/bbc/psammead/pull/3020) Add SVG for Learning English brand logo |
| 2.12.1 | [PR#2990](https://github.com/bbc/psammead/pull/2990) Use `GEL_SPACING_DBL` constant in `PhotoMediaIcon` and stories container |
| 2.12.0 | [PR#2935](https://github.com/bbc/psammead/pull/2935) Add a Clock icon to core icons |
Expand Down
1 change: 1 addition & 0 deletions packages/utilities/psammead-assets/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const ampBoilerplateExpectedExports = {
AMP_LIST_JS: 'object',
AMP_MUSTACHE_JS: 'object',
AMP_ADS_JS: 'object',
AMP_AD: 'object',
};

const svgsExpectedExports = {
Expand Down
2 changes: 1 addition & 1 deletion packages/utilities/psammead-assets/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/utilities/psammead-assets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/psammead-assets",
"version": "2.13.0",
"version": "2.14.0",
"sideEffects": false,
"description": "A collection of common assets that are likely to be required by many Psammead components or users, such as SVGs or small scripts.",
"repository": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`AMP Boilerplate JavaScript should render AMP AD 1`] = `
<script
async=""
custom-element="amp-ad"
src="https://cdn.ampproject.org/v0/amp-ad-0.1.js"
/>
`;

exports[`AMP Boilerplate JavaScript should render AMP Access JS 1`] = `
<script
async=""
Expand Down
7 changes: 7 additions & 0 deletions packages/utilities/psammead-assets/src/amp-boilerplate.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,10 @@ export const AMP_ADS_JS = (
src="https://cdn.ampproject.org/v0/amp-ad-0.1.js"
/>
);
export const AMP_AD = (
<script
async
custom-element="amp-ad"
src="https://cdn.ampproject.org/v0/amp-ad-0.1.js"
/>
);
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ describe('AMP Boilerplate', () => {
boilerplate.AMP_MUSTACHE_JS,
);
shouldMatchSnapshot('should render AMP ads JS', boilerplate.AMP_ADS_JS);
shouldMatchSnapshot('should render AMP AD', boilerplate.AMP_AD);
});
});

0 comments on commit 69345c9

Please sign in to comment.