diff --git a/ghost/core/test/e2e-api/admin/themes.test.js b/ghost/core/test/e2e-api/admin/themes.test.js index c2f1041173..39dc180156 100644 --- a/ghost/core/test/e2e-api/admin/themes.test.js +++ b/ghost/core/test/e2e-api/admin/themes.test.js @@ -177,7 +177,7 @@ describe('Themes API', function () { tmpFolderContents.splice(i, 1); } } - tmpFolderContents.should.be.an.Array().with.lengthOf(11); + tmpFolderContents.should.be.an.Array().with.lengthOf(12); tmpFolderContents.should.eql([ 'broken-theme', @@ -187,6 +187,7 @@ describe('Themes API', function () { 'locale-theme', 'members-test-theme', 'source', + 'source.zip', 'test-theme', 'test-theme-channels', 'valid.zip', diff --git a/ghost/core/test/utils/fixtures/themes/README.md b/ghost/core/test/utils/fixtures/themes/README.md index e8a45a41fd..7a84c916d3 100644 --- a/ghost/core/test/utils/fixtures/themes/README.md +++ b/ghost/core/test/utils/fixtures/themes/README.md @@ -19,7 +19,7 @@ To update it: - `cd tests/utils/fixtures/themes` - `rm -rf casper` -- `rsync -rv --exclude '.git*' --exclude 'assets/css*' --exclude 'assets/js*' --exclude 'gulpfile.js' --exclude 'yarn.lock' --exclude 'README.md' ../../../../content/themes/casper .` +- `rsync -rv --exclude '.git*' --exclude 'assets/css*' --exclude 'assets/js*' --exclude 'gulpfile.js' --exclude 'yarn.lock' --exclude 'README.md' --exclude 'node_modules' ../../../../content/themes/casper .` ## Updating the Source theme fixture The source fixture is a partial copy of the content/themes/source folder. @@ -38,7 +38,7 @@ To update it: - `cd tests/utils/fixtures/themes` - `rm -rf source` -- `rsync -rv --exclude '.git*' --exclude 'assets/css*' --exclude 'assets/js*' --exclude 'gulpfile.js' --exclude 'yarn.lock' --exclude 'README.md' ../../../../content/themes/source .` +- `rsync -rv --exclude '.git*' --exclude 'assets/css*' --exclude 'assets/js*' --exclude 'gulpfile.js' --exclude 'yarn.lock' --exclude 'README.md' --exclude 'node_modules' ../../../../content/themes/source .` ### Modifying theme fixtures When a new rule is introduced in gscan one of these fixture files might break and you'll have to update a "zip" which isn't as easy as opening a text editor... It could become that one day but for now here are some commands to help out with the edit process diff --git a/ghost/core/test/utils/fixtures/themes/casper.zip b/ghost/core/test/utils/fixtures/themes/casper.zip index dd87993538..01df7abad6 100644 Binary files a/ghost/core/test/utils/fixtures/themes/casper.zip and b/ghost/core/test/utils/fixtures/themes/casper.zip differ diff --git a/ghost/core/test/utils/fixtures/themes/casper/assets/built/casper.js b/ghost/core/test/utils/fixtures/themes/casper/assets/built/casper.js index 35c754bf6b..60a825487c 100644 --- a/ghost/core/test/utils/fixtures/themes/casper/assets/built/casper.js +++ b/ghost/core/test/utils/fixtures/themes/casper/assets/built/casper.js @@ -1,2 +1,2 @@ -!function(o){"use strict";o.fn.fitVids=function(e){var t,i,n={customSelector:null,ignore:null};return document.getElementById("fit-vids-style")||(t=document.head||document.getElementsByTagName("head")[0],(i=document.createElement("div")).innerHTML='
x
',t.appendChild(i.childNodes[1])),e&&o.extend(n,e),this.each(function(){var e=['iframe[src*="player.vimeo.com"]','iframe[src*="youtube.com"]','iframe[src*="youtube-nocookie.com"]','iframe[src*="kickstarter.com"][src*="video.html"]',"object","embed"];n.customSelector&&e.push(n.customSelector);var r=".fitvidsignore";n.ignore&&(r=r+", "+n.ignore);e=o(this).find(e.join(","));(e=(e=e.not("object object")).not(r)).each(function(){var e,t,i=o(this);0x
';\n head.appendChild(div.childNodes[1]);\n }\n\n if ( options ) {\n $.extend( settings, options );\n }\n\n return this.each(function(){\n var selectors = [\n 'iframe[src*=\"player.vimeo.com\"]',\n 'iframe[src*=\"youtube.com\"]',\n 'iframe[src*=\"youtube-nocookie.com\"]',\n 'iframe[src*=\"kickstarter.com\"][src*=\"video.html\"]',\n 'object',\n 'embed'\n ];\n\n if (settings.customSelector) {\n selectors.push(settings.customSelector);\n }\n\n var ignoreList = '.fitvidsignore';\n\n if(settings.ignore) {\n ignoreList = ignoreList + ', ' + settings.ignore;\n }\n\n var $allVideos = $(this).find(selectors.join(','));\n $allVideos = $allVideos.not('object object'); // SwfObj conflict patch\n $allVideos = $allVideos.not(ignoreList); // Disable FitVids on this video.\n\n $allVideos.each(function(){\n var $this = $(this);\n if($this.parents(ignoreList).length > 0) {\n return; // Disable FitVids on this video.\n }\n if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }\n if ((!$this.css('height') && !$this.css('width')) && (isNaN($this.attr('height')) || isNaN($this.attr('width'))))\n {\n $this.attr('height', 9);\n $this.attr('width', 16);\n }\n var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),\n width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),\n aspectRatio = height / width;\n if(!$this.attr('name')){\n var videoName = 'fitvid' + $.fn.fitVids._count;\n $this.attr('name', videoName);\n $.fn.fitVids._count++;\n }\n $this.wrap('