Skip to content

Commit

Permalink
[WEBDEV-947] Add telephone format detection meta (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
naseberry authored and joshuawaheed committed Nov 6, 2018
1 parent 0432f45 commit 2b856b0
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pugin-components",
"version": "0.8.2",
"version": "0.8.3",
"description": "A shunter npm package containing dust components for beta.parliament.uk",
"main": "index.js",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<title>UK Parliament</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta name="format-detection" content="telephone=no">
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"layout": {
"template": "layout"
},
"meta": {
"disable-format-detection": true
}
}
28 changes: 17 additions & 11 deletions test/unit/components/head/meta.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,31 @@ describe('Head meta dust component', function() {

context('with a request-id attribute', function() {
it('should return html from the dust component including the Appinsights meta tag', function(done) {
testHelper.shunterTest('meta-with-request-id', 'components__head__meta', 'components/head', done)
testHelper.shunterTest('meta-with-request-id', 'components__head__meta', 'components/head', done)
});
});

context('with a simple title attribute', function() {
it('should return html from the dust component including the title given', function(done) {
testHelper.shunterTest('meta-with-simple-title', 'components__head__meta', 'components/head', done)
});
it('should return html from the dust component including the title given', function(done) {
testHelper.shunterTest('meta-with-simple-title', 'components__head__meta', 'components/head', done)
});
});

context('with a translation title attribute', function() {
it('should return html from the dust component including the translated title', function(done) {
testHelper.shunterTest('meta-with-translation-title', 'components__head__meta', 'components/head', done)
});
it('should return html from the dust component including the translated title', function(done) {
testHelper.shunterTest('meta-with-translation-title', 'components__head__meta', 'components/head', done)
});
});

context('with no title attribute given', function() {
it('should return html from the dust component including the shared title', function(done) {
testHelper.shunterTest('meta-with-no-title', 'components__head__meta', 'components/head', done)
});
});

context('with no title attribute given', function() {
it('should return html from the dust component including the shared title', function(done) {
testHelper.shunterTest('meta-with-no-title', 'components__head__meta', 'components/head', done)
});
context('with a format detection attribute', function() {
it('should return html from the dust component including the format-detection meta tag', function(done) {
testHelper.shunterTest('meta-with-format-detection', 'components__head__meta', 'components/head', done)
});
});
});
5 changes: 4 additions & 1 deletion view/components/head/meta.dust
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
{?meta.request-id}
<meta name="applicationinsights-request-id" content="{meta.request-id}" >
<meta name="applicationinsights-request-id" content="{meta.request-id}" >
{/meta.request-id}
{?meta.disable-format-detection}
<meta name="format-detection" content="telephone=no">
{/meta.disable-format-detection}

0 comments on commit 2b856b0

Please sign in to comment.