mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 20:03:12 +03:00
Moved frontend unit tests into their own folder
- this is a small part of a bit of cleanup of our test files - the goal is to make the existing tests clearer with a view to making it easier to write more tests - this makes the test structure follow the codebase structure more closely - eventually we will colocate the frontend tests with the frontend code
This commit is contained in:
parent
e849167472
commit
95d27e7f58
@ -1,7 +1,7 @@
|
||||
const should = require('should');
|
||||
|
||||
// Stuff we are testing
|
||||
const ampComponentsHelper = require('../../../../core/frontend/apps/amp/lib/helpers/amp_components');
|
||||
const ampComponentsHelper = require('../../../../../core/frontend/apps/amp/lib/helpers/amp_components');
|
||||
|
||||
describe('{{amp_components}} helper', function () {
|
||||
it('adds script tag for a gif', function () {
|
@ -1,8 +1,8 @@
|
||||
const should = require('should');
|
||||
const rewire = require('rewire');
|
||||
const nock = require('nock');
|
||||
const urlUtils = require('../../../utils/urlUtils');
|
||||
const ampContentHelper = rewire('../../../../core/frontend/apps/amp/lib/helpers/amp_content');
|
||||
const urlUtils = require('../../../../utils/urlUtils');
|
||||
const ampContentHelper = rewire('../../../../../core/frontend/apps/amp/lib/helpers/amp_content');
|
||||
|
||||
// TODO: Amperize really needs to get stubbed, so we can test returning errors
|
||||
// properly and make this test faster!
|
@ -2,11 +2,11 @@ const errors = require('@tryghost/errors');
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const path = require('path');
|
||||
const ampController = require('../../../../core/frontend/apps/amp/lib/router');
|
||||
const urlService = require('../../../../core/frontend/services/url');
|
||||
const helpers = require('../../../../core/frontend/services/routing/helpers');
|
||||
const testUtils = require('../../../utils');
|
||||
const configUtils = require('../../../utils/configUtils');
|
||||
const ampController = require('../../../../../core/frontend/apps/amp/lib/router');
|
||||
const urlService = require('../../../../../core/frontend/services/url');
|
||||
const helpers = require('../../../../../core/frontend/services/routing/helpers');
|
||||
const testUtils = require('../../../../utils');
|
||||
const configUtils = require('../../../../utils/configUtils');
|
||||
|
||||
// Helper function to prevent unit tests
|
||||
// from failing via timeout when they
|
@ -1,9 +1,9 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const path = require('path');
|
||||
const configUtils = require('../../../utils/configUtils');
|
||||
const themeEngine = require('../../../../core/frontend/services/theme-engine');
|
||||
const privateController = require('../../../../core/frontend/apps/private-blogging/lib/router');
|
||||
const configUtils = require('../../../../utils/configUtils');
|
||||
const themeEngine = require('../../../../../core/frontend/services/theme-engine');
|
||||
const privateController = require('../../../../../core/frontend/apps/private-blogging/lib/router');
|
||||
|
||||
describe('Private Controller', function () {
|
||||
let res;
|
@ -2,7 +2,7 @@
|
||||
const should = require('should');
|
||||
|
||||
// Stuff we are testing
|
||||
const input_password = require('../../../../core/frontend/apps/private-blogging/lib/helpers/input_password');
|
||||
const input_password = require('../../../../../core/frontend/apps/private-blogging/lib/helpers/input_password');
|
||||
|
||||
describe('{{input_password}} helper', function () {
|
||||
it('has input_password helper', function () {
|
@ -3,8 +3,8 @@ const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const crypto = require('crypto');
|
||||
const fs = require('fs-extra');
|
||||
const settingsCache = require('../../../../core/shared/settings-cache');
|
||||
const privateBlogging = require('../../../../core/frontend/apps/private-blogging/lib/middleware');
|
||||
const settingsCache = require('../../../../../core/shared/settings-cache');
|
||||
const privateBlogging = require('../../../../../core/frontend/apps/private-blogging/lib/middleware');
|
||||
|
||||
function hash(password, salt) {
|
||||
const hasher = crypto.createHash('sha256');
|
@ -4,9 +4,9 @@
|
||||
const should = require('should');
|
||||
|
||||
const sinon = require('sinon');
|
||||
const configUtils = require('../../utils/configUtils');
|
||||
const asset = require('../../../core/frontend/helpers/asset');
|
||||
const settingsCache = require('../../../core/shared/settings-cache');
|
||||
const configUtils = require('../../../utils/configUtils');
|
||||
const asset = require('../../../../core/frontend/helpers/asset');
|
||||
const settingsCache = require('../../../../core/shared/settings-cache');
|
||||
|
||||
describe('{{asset}} helper', function () {
|
||||
let rendered;
|
@ -1,8 +1,8 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const testUtils = require('../../utils');
|
||||
const urlService = require('../../../core/frontend/services/url');
|
||||
const authorHelper = require('../../../core/frontend/helpers/author');
|
||||
const testUtils = require('../../../utils');
|
||||
const urlService = require('../../../../core/frontend/services/url');
|
||||
const authorHelper = require('../../../../core/frontend/helpers/author');
|
||||
|
||||
describe('{{author}} helper', function () {
|
||||
beforeEach(function () {
|
@ -1,9 +1,9 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const urlService = require('../../../core/frontend/services/url');
|
||||
const authorsHelper = require('../../../core/frontend/helpers/authors');
|
||||
const models = require('../../../core/server/models');
|
||||
const testUtils = require('../../utils');
|
||||
const urlService = require('../../../../core/frontend/services/url');
|
||||
const authorsHelper = require('../../../../core/frontend/helpers/authors');
|
||||
const models = require('../../../../core/server/models');
|
||||
const testUtils = require('../../../utils');
|
||||
|
||||
describe('{{authors}} helper', function () {
|
||||
before(function () {
|
@ -1,8 +1,8 @@
|
||||
const should = require('should');
|
||||
const themeList = require('../../../core/server/services/themes/list');
|
||||
const themeList = require('../../../../core/server/services/themes/list');
|
||||
|
||||
// Stuff we are testing
|
||||
const body_class = require('../../../core/frontend/helpers/body_class');
|
||||
const body_class = require('../../../../core/frontend/helpers/body_class');
|
||||
|
||||
describe('{{body_class}} helper', function () {
|
||||
let options = {};
|
@ -1,9 +1,9 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const hbs = require('../../../core/frontend/services/theme-engine/engine');
|
||||
const cancel_link = require('../../../core/frontend/helpers/cancel_link');
|
||||
const labs = require('../../../core/shared/labs');
|
||||
const configUtils = require('../../utils/configUtils');
|
||||
const hbs = require('../../../../core/frontend/services/theme-engine/engine');
|
||||
const cancel_link = require('../../../../core/frontend/helpers/cancel_link');
|
||||
const labs = require('../../../../core/shared/labs');
|
||||
const configUtils = require('../../../utils/configUtils');
|
||||
|
||||
describe('{{cancel_link}} helper', function () {
|
||||
let labsStub;
|
@ -1,10 +1,10 @@
|
||||
const should = require('should');
|
||||
const handlebars = require('../../../core/frontend/services/theme-engine/engine').handlebars;
|
||||
const handlebars = require('../../../../core/frontend/services/theme-engine/engine').handlebars;
|
||||
|
||||
const concat = require('../../../core/frontend/helpers/concat');
|
||||
const url = require('../../../core/frontend/helpers/url');
|
||||
const concat = require('../../../../core/frontend/helpers/concat');
|
||||
const url = require('../../../../core/frontend/helpers/url');
|
||||
|
||||
const configUtils = require('../../utils/configUtils');
|
||||
const configUtils = require('../../../utils/configUtils');
|
||||
|
||||
let defaultGlobals;
|
||||
|
@ -1,10 +1,10 @@
|
||||
const should = require('should');
|
||||
const hbs = require('../../../core/frontend/services/theme-engine/engine');
|
||||
const configUtils = require('../../utils/configUtils');
|
||||
const hbs = require('../../../../core/frontend/services/theme-engine/engine');
|
||||
const configUtils = require('../../../utils/configUtils');
|
||||
const path = require('path');
|
||||
|
||||
// Stuff we are testing
|
||||
const content = require('../../../core/frontend/helpers/content');
|
||||
const content = require('../../../../core/frontend/helpers/content');
|
||||
|
||||
describe('{{content}} helper', function () {
|
||||
before(function (done) {
|
@ -2,7 +2,7 @@ const sinon = require('sinon');
|
||||
const should = require('should');
|
||||
|
||||
// Stuff we are testing
|
||||
const date = require('../../../core/frontend/helpers/date');
|
||||
const date = require('../../../../core/frontend/helpers/date');
|
||||
|
||||
const moment = require('moment-timezone');
|
||||
|
@ -1,7 +1,7 @@
|
||||
const should = require('should');
|
||||
|
||||
// Stuff we are testing
|
||||
const encode = require('../../../core/frontend/helpers/encode');
|
||||
const encode = require('../../../../core/frontend/helpers/encode');
|
||||
|
||||
describe('{{encode}} helper', function () {
|
||||
it('can escape URI', function () {
|
@ -1,7 +1,7 @@
|
||||
const should = require('should');
|
||||
|
||||
// Stuff we are testing
|
||||
const excerpt = require('../../../core/frontend/helpers/excerpt');
|
||||
const excerpt = require('../../../../core/frontend/helpers/excerpt');
|
||||
|
||||
describe('{{excerpt}} Helper', function () {
|
||||
it('renders empty string when html, excerpt, and custom_excerpt are null', function () {
|
@ -1,7 +1,7 @@
|
||||
const should = require('should');
|
||||
|
||||
// Stuff we are testing
|
||||
const facebook_url = require('../../../core/frontend/helpers/facebook_url');
|
||||
const facebook_url = require('../../../../core/frontend/helpers/facebook_url');
|
||||
|
||||
describe('{{facebook_url}} helper', function () {
|
||||
const options = {data: {site: {}}};
|
@ -1,8 +1,8 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const _ = require('lodash');
|
||||
const foreach = require('../../../core/frontend/helpers/foreach');
|
||||
const handlebars = require('../../../core/frontend/services/theme-engine/engine').handlebars;
|
||||
const foreach = require('../../../../core/frontend/helpers/foreach');
|
||||
const handlebars = require('../../../../core/frontend/services/theme-engine/engine').handlebars;
|
||||
|
||||
describe('{{#foreach}} helper', function () {
|
||||
let options;
|
@ -1,13 +1,13 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const Promise = require('bluebird');
|
||||
const {SafeString} = require('../../../core/frontend/services/rendering');
|
||||
const {SafeString} = require('../../../../core/frontend/services/rendering');
|
||||
|
||||
// Stuff we are testing
|
||||
const get = require('../../../core/frontend/helpers/get');
|
||||
const get = require('../../../../core/frontend/helpers/get');
|
||||
|
||||
const models = require('../../../core/server/models');
|
||||
const api = require('../../../core/server/api');
|
||||
const models = require('../../../../core/server/models');
|
||||
const api = require('../../../../core/server/api');
|
||||
|
||||
describe('{{#get}} helper', function () {
|
||||
let fn;
|
@ -1,7 +1,7 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const ghost_foot = require('../../../core/frontend/helpers/ghost_foot');
|
||||
const {settingsCache} = require('../../../core/frontend/services/proxy');
|
||||
const ghost_foot = require('../../../../core/frontend/helpers/ghost_foot');
|
||||
const {settingsCache} = require('../../../../core/frontend/services/proxy');
|
||||
|
||||
describe('{{ghost_foot}} helper', function () {
|
||||
let settingsCacheStub;
|
@ -4,16 +4,16 @@ const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const _ = require('lodash');
|
||||
const moment = require('moment');
|
||||
const testUtils = require('../../utils');
|
||||
const configUtils = require('../../utils/configUtils');
|
||||
const themeEngine = require('../../../core/frontend/services/theme-engine');
|
||||
const models = require('../../../core/server/models');
|
||||
const imageLib = require('../../../core/server/lib/image');
|
||||
const routing = require('../../../core/frontend/services/routing');
|
||||
const urlService = require('../../../core/frontend/services/url');
|
||||
const testUtils = require('../../../utils');
|
||||
const configUtils = require('../../../utils/configUtils');
|
||||
const themeEngine = require('../../../../core/frontend/services/theme-engine');
|
||||
const models = require('../../../../core/server/models');
|
||||
const imageLib = require('../../../../core/server/lib/image');
|
||||
const routing = require('../../../../core/frontend/services/routing');
|
||||
const urlService = require('../../../../core/frontend/services/url');
|
||||
|
||||
const ghost_head = require('../../../core/frontend/helpers/ghost_head');
|
||||
const {settingsCache} = require('../../../core/frontend/services/proxy');
|
||||
const ghost_head = require('../../../../core/frontend/helpers/ghost_head');
|
||||
const {settingsCache} = require('../../../../core/frontend/services/proxy');
|
||||
|
||||
describe('{{ghost_head}} helper', function () {
|
||||
let posts = [];
|
@ -2,7 +2,7 @@ const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
|
||||
// Stuff we are testing
|
||||
const has = require('../../../core/frontend/helpers/has');
|
||||
const has = require('../../../../core/frontend/helpers/has');
|
||||
|
||||
describe('{{#has}} helper', function () {
|
||||
let fn;
|
@ -1,9 +1,9 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const configUtils = require('../../utils/configUtils');
|
||||
const configUtils = require('../../../utils/configUtils');
|
||||
|
||||
// Stuff we are testing
|
||||
const img_url = require('../../../core/frontend/helpers/img_url');
|
||||
const img_url = require('../../../../core/frontend/helpers/img_url');
|
||||
|
||||
const logging = require('@tryghost/logging');
|
||||
|
@ -1,5 +1,5 @@
|
||||
const sinon = require('sinon');
|
||||
const is = require('../../../core/frontend/helpers/is');
|
||||
const is = require('../../../../core/frontend/helpers/is');
|
||||
const logging = require('@tryghost/logging');
|
||||
|
||||
describe('{{#is}} helper', function () {
|
@ -1,5 +1,5 @@
|
||||
const should = require('should');
|
||||
const lang = require('../../../core/frontend/helpers/lang');
|
||||
const lang = require('../../../../core/frontend/helpers/lang');
|
||||
|
||||
describe('{{lang}} helper', function () {
|
||||
it('returns correct language tag', function () {
|
@ -1,10 +1,10 @@
|
||||
const should = require('should');
|
||||
const concat = require('../../../core/frontend/helpers/concat');
|
||||
const link = require('../../../core/frontend/helpers/link');
|
||||
const url = require('../../../core/frontend/helpers/url');
|
||||
const handlebars = require('../../../core/frontend/services/theme-engine/engine').handlebars;
|
||||
const concat = require('../../../../core/frontend/helpers/concat');
|
||||
const link = require('../../../../core/frontend/helpers/link');
|
||||
const url = require('../../../../core/frontend/helpers/url');
|
||||
const handlebars = require('../../../../core/frontend/services/theme-engine/engine').handlebars;
|
||||
|
||||
const configUtils = require('../../utils/configUtils');
|
||||
const configUtils = require('../../../utils/configUtils');
|
||||
|
||||
let defaultGlobals;
|
||||
|
@ -1,9 +1,9 @@
|
||||
const should = require('should');
|
||||
const concat = require('../../../core/frontend/helpers/concat');
|
||||
const link_class = require('../../../core/frontend/helpers/link_class');
|
||||
const handlebars = require('../../../core/frontend/services/theme-engine/engine').handlebars;
|
||||
const concat = require('../../../../core/frontend/helpers/concat');
|
||||
const link_class = require('../../../../core/frontend/helpers/link_class');
|
||||
const handlebars = require('../../../../core/frontend/services/theme-engine/engine').handlebars;
|
||||
|
||||
const configUtils = require('../../utils/configUtils');
|
||||
const configUtils = require('../../../utils/configUtils');
|
||||
|
||||
let defaultGlobals;
|
||||
|
@ -1,9 +1,9 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const _ = require('lodash');
|
||||
const match = require('../../../core/frontend/helpers/match');
|
||||
const labs = require('../../../core/shared/labs');
|
||||
const handlebars = require('../../../core/frontend/services/theme-engine/engine').handlebars;
|
||||
const match = require('../../../../core/frontend/helpers/match');
|
||||
const labs = require('../../../../core/shared/labs');
|
||||
const handlebars = require('../../../../core/frontend/services/theme-engine/engine').handlebars;
|
||||
|
||||
describe('Match helper', function () {
|
||||
before(function () {
|
@ -1,7 +1,7 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const meta_description = require('../../../core/frontend/helpers/meta_description');
|
||||
const settingsCache = require('../../../core/shared/settings-cache');
|
||||
const meta_description = require('../../../../core/frontend/helpers/meta_description');
|
||||
const settingsCache = require('../../../../core/shared/settings-cache');
|
||||
|
||||
describe('{{meta_description}} helper', function () {
|
||||
const localSettingsCache = {};
|
@ -1,8 +1,8 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const configUtils = require('../../utils/configUtils');
|
||||
const meta_title = require('../../../core/frontend/helpers/meta_title');
|
||||
const settingsCache = require('../../../core/shared/settings-cache');
|
||||
const configUtils = require('../../../utils/configUtils');
|
||||
const meta_title = require('../../../../core/frontend/helpers/meta_title');
|
||||
const settingsCache = require('../../../../core/shared/settings-cache');
|
||||
|
||||
describe('{{meta_title}} helper', function () {
|
||||
describe('no meta_title', function () {
|
@ -1,15 +1,15 @@
|
||||
const should = require('should');
|
||||
const hbs = require('../../../core/frontend/services/theme-engine/engine');
|
||||
const configUtils = require('../../utils/configUtils');
|
||||
const hbs = require('../../../../core/frontend/services/theme-engine/engine');
|
||||
const configUtils = require('../../../utils/configUtils');
|
||||
const path = require('path');
|
||||
|
||||
const concat = require('../../../core/frontend/helpers/concat');
|
||||
const foreach = require('../../../core/frontend/helpers/foreach');
|
||||
const link_class = require('../../../core/frontend/helpers/link_class');
|
||||
const url = require('../../../core/frontend/helpers/url');
|
||||
const navigation = require('../../../core/frontend/helpers/navigation');
|
||||
const concat = require('../../../../core/frontend/helpers/concat');
|
||||
const foreach = require('../../../../core/frontend/helpers/foreach');
|
||||
const link_class = require('../../../../core/frontend/helpers/link_class');
|
||||
const url = require('../../../../core/frontend/helpers/url');
|
||||
const navigation = require('../../../../core/frontend/helpers/navigation');
|
||||
|
||||
const handlebars = require('../../../core/frontend/services/theme-engine/engine').handlebars;
|
||||
const handlebars = require('../../../../core/frontend/services/theme-engine/engine').handlebars;
|
||||
|
||||
const runHelper = data => navigation.call({}, data);
|
||||
const runHelperThunk = data => () => runHelper(data);
|
@ -1,9 +1,9 @@
|
||||
const errors = require('@tryghost/errors');
|
||||
const sinon = require('sinon');
|
||||
const Promise = require('bluebird');
|
||||
const markdownToMobiledoc = require('../../utils/fixtures/data-generator').markdownToMobiledoc;
|
||||
const next_post = require('../../../core/frontend/helpers/prev_post');
|
||||
const api = require('../../../core/server/api');
|
||||
const markdownToMobiledoc = require('../../../utils/fixtures/data-generator').markdownToMobiledoc;
|
||||
const next_post = require('../../../../core/frontend/helpers/prev_post');
|
||||
const api = require('../../../../core/server/api');
|
||||
|
||||
describe('{{next_post}} helper', function () {
|
||||
const apiVersion = 'canary';
|
@ -1,7 +1,7 @@
|
||||
const should = require('should');
|
||||
|
||||
// Stuff we are testing
|
||||
const page_url = require('../../../core/frontend/helpers/page_url');
|
||||
const page_url = require('../../../../core/frontend/helpers/page_url');
|
||||
|
||||
describe('{{page_url}} helper', function () {
|
||||
const options = {data: {root: {pagination: {}}}};
|
@ -1,9 +1,9 @@
|
||||
const should = require('should');
|
||||
const hbs = require('../../../core/frontend/services/theme-engine/engine');
|
||||
const configUtils = require('../../utils/configUtils');
|
||||
const hbs = require('../../../../core/frontend/services/theme-engine/engine');
|
||||
const configUtils = require('../../../utils/configUtils');
|
||||
const path = require('path');
|
||||
const page_url = require('../../../core/frontend/helpers/page_url');
|
||||
const pagination = require('../../../core/frontend/helpers/pagination');
|
||||
const page_url = require('../../../../core/frontend/helpers/page_url');
|
||||
const pagination = require('../../../../core/frontend/helpers/pagination');
|
||||
|
||||
describe('{{pagination}} helper', function () {
|
||||
before(function (done) {
|
@ -1,7 +1,7 @@
|
||||
const should = require('should');
|
||||
|
||||
// Stuff we are testing
|
||||
const plural = require('../../../core/frontend/helpers/plural');
|
||||
const plural = require('../../../../core/frontend/helpers/plural');
|
||||
|
||||
describe('{{plural}} helper', function () {
|
||||
it('will show no-value string', function () {
|
@ -1,7 +1,7 @@
|
||||
const should = require('should');
|
||||
|
||||
// Stuff we are testing
|
||||
const post_class = require('../../../core/frontend/helpers/post_class');
|
||||
const post_class = require('../../../../core/frontend/helpers/post_class');
|
||||
|
||||
describe('{{post_class}} helper', function () {
|
||||
it('can render class string', function () {
|
@ -1,9 +1,9 @@
|
||||
const errors = require('@tryghost/errors');
|
||||
const sinon = require('sinon');
|
||||
const Promise = require('bluebird');
|
||||
const markdownToMobiledoc = require('../../utils/fixtures/data-generator').markdownToMobiledoc;
|
||||
const prev_post = require('../../../core/frontend/helpers/prev_post');
|
||||
const api = require('../../../core/server/api');
|
||||
const markdownToMobiledoc = require('../../../utils/fixtures/data-generator').markdownToMobiledoc;
|
||||
const prev_post = require('../../../../core/frontend/helpers/prev_post');
|
||||
const api = require('../../../../core/server/api');
|
||||
|
||||
describe('{{prev_post}} helper', function () {
|
||||
const apiVersion = 'canary';
|
@ -1,6 +1,6 @@
|
||||
const should = require('should');
|
||||
const price = require('../../../core/frontend/helpers/price');
|
||||
const handlebars = require('../../../core/frontend/services/theme-engine/engine').handlebars;
|
||||
const price = require('../../../../core/frontend/helpers/price');
|
||||
const handlebars = require('../../../../core/frontend/services/theme-engine/engine').handlebars;
|
||||
|
||||
function compile(templateString) {
|
||||
const template = handlebars.compile(templateString);
|
@ -1,6 +1,6 @@
|
||||
const should = require('should');
|
||||
const raw = require('../../../core/frontend/helpers/raw');
|
||||
const handlebars = require('../../../core/frontend/services/theme-engine/engine').handlebars;
|
||||
const raw = require('../../../../core/frontend/helpers/raw');
|
||||
const handlebars = require('../../../../core/frontend/services/theme-engine/engine').handlebars;
|
||||
|
||||
let defaultGlobals;
|
||||
|
@ -1,7 +1,7 @@
|
||||
const should = require('should');
|
||||
|
||||
// Stuff we are testing
|
||||
const reading_time = require('../../../core/frontend/helpers/reading_time');
|
||||
const reading_time = require('../../../../core/frontend/helpers/reading_time');
|
||||
|
||||
const almostOneMinute =
|
||||
'<p>Ghost has a number of different user roles for your team</p>' +
|
@ -1,13 +1,13 @@
|
||||
const should = require('should');
|
||||
const path = require('path');
|
||||
const t = require('../../../core/frontend/helpers/t');
|
||||
const themeI18n = require('../../../core/frontend/services/theme-engine/i18n');
|
||||
const t = require('../../../../core/frontend/helpers/t');
|
||||
const themeI18n = require('../../../../core/frontend/services/theme-engine/i18n');
|
||||
|
||||
describe('{{t}} helper', function () {
|
||||
let ogBasePath = themeI18n.basePath;
|
||||
|
||||
before(function () {
|
||||
themeI18n.basePath = path.join(__dirname, '../../utils/fixtures/themes/');
|
||||
themeI18n.basePath = path.join(__dirname, '../../../utils/fixtures/themes/');
|
||||
});
|
||||
|
||||
after(function () {
|
@ -1,9 +1,9 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const testUtils = require('../../utils');
|
||||
const urlService = require('../../../core/frontend/services/url');
|
||||
const models = require('../../../core/server/models');
|
||||
const tagsHelper = require('../../../core/frontend/helpers/tags');
|
||||
const testUtils = require('../../../utils');
|
||||
const urlService = require('../../../../core/frontend/services/url');
|
||||
const models = require('../../../../core/server/models');
|
||||
const tagsHelper = require('../../../../core/frontend/helpers/tags');
|
||||
|
||||
describe('{{tags}} helper', function () {
|
||||
before(function () {
|
@ -1,7 +1,7 @@
|
||||
const should = require('should');
|
||||
|
||||
// Stuff we are testing
|
||||
const title = require('../../../core/frontend/helpers/title');
|
||||
const title = require('../../../../core/frontend/helpers/title');
|
||||
|
||||
describe('{{title}} Helper', function () {
|
||||
it('can render title', function () {
|
@ -1,7 +1,7 @@
|
||||
const should = require('should');
|
||||
|
||||
// Stuff we are testing
|
||||
const twitter_url = require('../../../core/frontend/helpers/twitter_url');
|
||||
const twitter_url = require('../../../../core/frontend/helpers/twitter_url');
|
||||
|
||||
describe('{{twitter_url}} helper', function () {
|
||||
const options = {data: {site: {}}};
|
@ -1,13 +1,13 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const Promise = require('bluebird');
|
||||
const testUtils = require('../../utils');
|
||||
const testUtils = require('../../../utils');
|
||||
|
||||
const configUtils = require('../../utils/configUtils');
|
||||
const markdownToMobiledoc = require('../../utils/fixtures/data-generator').markdownToMobiledoc;
|
||||
const url = require('../../../core/frontend/helpers/url');
|
||||
const urlService = require('../../../core/frontend/services/url');
|
||||
const api = require('../../../core/server/api');
|
||||
const configUtils = require('../../../utils/configUtils');
|
||||
const markdownToMobiledoc = require('../../../utils/fixtures/data-generator').markdownToMobiledoc;
|
||||
const url = require('../../../../core/frontend/helpers/url');
|
||||
const urlService = require('../../../../core/frontend/services/url');
|
||||
const api = require('../../../../core/server/api');
|
||||
|
||||
describe('{{url}} helper', function () {
|
||||
let rendered;
|
@ -1,10 +1,10 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const rewire = require('rewire');
|
||||
const urlUtils = require('../../../core/shared/url-utils');
|
||||
const testUtils = require('../../utils');
|
||||
const urlUtils = require('../../../../core/shared/url-utils');
|
||||
const testUtils = require('../../../utils');
|
||||
|
||||
let getAmpUrl = rewire('../../../core/frontend/meta/amp-url');
|
||||
let getAmpUrl = rewire('../../../../core/frontend/meta/amp-url');
|
||||
|
||||
describe('getAmpUrl', function () {
|
||||
let getUrlStub;
|
||||
@ -12,7 +12,7 @@ describe('getAmpUrl', function () {
|
||||
beforeEach(function () {
|
||||
getUrlStub = sinon.stub();
|
||||
|
||||
getAmpUrl = rewire('../../../core/frontend/meta/amp-url');
|
||||
getAmpUrl = rewire('../../../../core/frontend/meta/amp-url');
|
||||
getAmpUrl.__set__('getUrl', getUrlStub);
|
||||
|
||||
sinon.stub(urlUtils, 'urlJoin');
|
@ -1,12 +1,12 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const rewire = require('rewire');
|
||||
const imageLib = require('../../../core/server/lib/image');
|
||||
const settingsCache = require('../../../core/shared/settings-cache');
|
||||
const configUtils = require('../../utils/configUtils');
|
||||
const imageLib = require('../../../../core/server/lib/image');
|
||||
const settingsCache = require('../../../../core/shared/settings-cache');
|
||||
const configUtils = require('../../../utils/configUtils');
|
||||
const config = configUtils.config;
|
||||
|
||||
const getAssetUrl = rewire('../../../core/frontend/meta/asset-url');
|
||||
const getAssetUrl = rewire('../../../../core/frontend/meta/asset-url');
|
||||
|
||||
describe('getAssetUrl', function () {
|
||||
afterEach(function () {
|
@ -1,5 +1,5 @@
|
||||
const should = require('should');
|
||||
const getAuthorFacebookUrl = require('../../../core/frontend/meta/author-fb-url');
|
||||
const getAuthorFacebookUrl = require('../../../../core/frontend/meta/author-fb-url');
|
||||
|
||||
describe('getAuthorFacebookUrl', function () {
|
||||
it('should return author facebook url if post and has url',
|
@ -1,6 +1,6 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const getAuthorImage = require('../../../core/frontend/meta/author-image');
|
||||
const getAuthorImage = require('../../../../core/frontend/meta/author-image');
|
||||
|
||||
describe('getAuthorImage', function () {
|
||||
afterEach(function () {
|
@ -1,8 +1,8 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const ObjectId = require('bson-objectid');
|
||||
const urlService = require('../../../core/frontend/services/url');
|
||||
const getAuthorUrl = require('../../../core/frontend/meta/author-url');
|
||||
const urlService = require('../../../../core/frontend/services/url');
|
||||
const getAuthorUrl = require('../../../../core/frontend/meta/author-url');
|
||||
|
||||
describe('getAuthorUrl', function () {
|
||||
beforeEach(function () {
|
@ -1,7 +1,7 @@
|
||||
const should = require('should');
|
||||
const getBlogLogo = require('../../../core/frontend/meta/blog-logo');
|
||||
const getBlogLogo = require('../../../../core/frontend/meta/blog-logo');
|
||||
const sinon = require('sinon');
|
||||
const settingsCache = require('../../../core/shared/settings-cache');
|
||||
const settingsCache = require('../../../../core/shared/settings-cache');
|
||||
|
||||
describe('getBlogLogo', function () {
|
||||
afterEach(function () {
|
@ -1,10 +1,10 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const rewire = require('rewire');
|
||||
const urlUtils = require('../../../core/shared/url-utils');
|
||||
const testUtils = require('../../utils');
|
||||
const urlUtils = require('../../../../core/shared/url-utils');
|
||||
const testUtils = require('../../../utils');
|
||||
|
||||
let getCanonicalUrl = rewire('../../../core/frontend/meta/canonical-url');
|
||||
let getCanonicalUrl = rewire('../../../../core/frontend/meta/canonical-url');
|
||||
|
||||
describe('getCanonicalUrl', function () {
|
||||
let getUrlStub;
|
||||
@ -12,7 +12,7 @@ describe('getCanonicalUrl', function () {
|
||||
beforeEach(function () {
|
||||
getUrlStub = sinon.stub();
|
||||
|
||||
getCanonicalUrl = rewire('../../../core/frontend/meta/canonical-url');
|
||||
getCanonicalUrl = rewire('../../../../core/frontend/meta/canonical-url');
|
||||
getCanonicalUrl.__set__('getUrl', getUrlStub);
|
||||
|
||||
sinon.stub(urlUtils, 'urlJoin');
|
@ -1,7 +1,7 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const getContextObject = require('../../../core/frontend/meta/context-object.js');
|
||||
const settingsCache = require('../../../core/shared/settings-cache');
|
||||
const getContextObject = require('../../../../core/frontend/meta/context-object.js');
|
||||
const settingsCache = require('../../../../core/shared/settings-cache');
|
||||
|
||||
describe('getContextObject', function () {
|
||||
let data;
|
@ -1,5 +1,5 @@
|
||||
const should = require('should');
|
||||
const getCoverImage = require('../../../core/frontend/meta/cover-image');
|
||||
const getCoverImage = require('../../../../core/frontend/meta/cover-image');
|
||||
|
||||
describe('getCoverImage', function () {
|
||||
it('should return absolute cover image url for home', function () {
|
@ -1,5 +1,5 @@
|
||||
const should = require('should');
|
||||
const getCreatorTwitterUrl = require('../../../core/frontend/meta/creator-url');
|
||||
const getCreatorTwitterUrl = require('../../../../core/frontend/meta/creator-url');
|
||||
|
||||
describe('getCreatorTwitterUrl', function () {
|
||||
it('should return author twitter url if post and has url',
|
@ -1,7 +1,7 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const getMetaDescription = require('../../../core/frontend/meta/description');
|
||||
const settingsCache = require('../../../core/shared/settings-cache');
|
||||
const getMetaDescription = require('../../../../core/frontend/meta/description');
|
||||
const settingsCache = require('../../../../core/shared/settings-cache');
|
||||
|
||||
describe('getMetaDescription', function () {
|
||||
let localSettingsCache = {};
|
@ -1,5 +1,5 @@
|
||||
const should = require('should');
|
||||
const generateExcerpt = require('../../../core/frontend/meta/generate-excerpt');
|
||||
const generateExcerpt = require('../../../../core/frontend/meta/generate-excerpt');
|
||||
|
||||
describe('generateExcerpt', function () {
|
||||
it('should return html excerpt with no html', function () {
|
@ -1,7 +1,7 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const rewire = require('rewire');
|
||||
const getImageDimensions = rewire('../../../core/frontend/meta/image-dimensions');
|
||||
const getImageDimensions = rewire('../../../../core/frontend/meta/image-dimensions');
|
||||
|
||||
describe('getImageDimensions', function () {
|
||||
let sizeOfStub;
|
@ -1,7 +1,7 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const models = require('../../../core/server/models');
|
||||
const getKeywords = require('../../../core/frontend/meta/keywords');
|
||||
const models = require('../../../../core/server/models');
|
||||
const getKeywords = require('../../../../core/frontend/meta/keywords');
|
||||
|
||||
describe('getKeywords', function () {
|
||||
before(function () {
|
@ -1,5 +1,5 @@
|
||||
const should = require('should');
|
||||
const getModifiedDate = require('../../../core/frontend/meta/modified-date');
|
||||
const getModifiedDate = require('../../../../core/frontend/meta/modified-date');
|
||||
|
||||
describe('getModifiedDate', function () {
|
||||
it('should return updated at date as ISO 8601 from context if exists', function () {
|
@ -1,7 +1,7 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const getOgImage = require('../../../core/frontend/meta/og-image');
|
||||
const settingsCache = require('../../../core/shared/settings-cache');
|
||||
const getOgImage = require('../../../../core/frontend/meta/og-image');
|
||||
const settingsCache = require('../../../../core/shared/settings-cache');
|
||||
|
||||
describe('getOgImage', function () {
|
||||
let localSettingsCache = {};
|
@ -1,5 +1,5 @@
|
||||
const should = require('should');
|
||||
const getOgType = require('../../../core/frontend/meta/og-type');
|
||||
const getOgType = require('../../../../core/frontend/meta/og-type');
|
||||
|
||||
describe('getOgType', function () {
|
||||
it('should return og type profile if context is type author', function () {
|
@ -1,6 +1,6 @@
|
||||
const should = require('should');
|
||||
const getPaginatedUrl = require('../../../core/frontend/meta/paginated-url');
|
||||
const configUtils = require('../../utils/configUtils');
|
||||
const getPaginatedUrl = require('../../../../core/frontend/meta/paginated-url');
|
||||
const configUtils = require('../../../utils/configUtils');
|
||||
|
||||
describe('getPaginatedUrl', function () {
|
||||
let data;
|
@ -1,5 +1,5 @@
|
||||
const should = require('should');
|
||||
const getPublishedDate = require('../../../core/frontend/meta/published-date');
|
||||
const getPublishedDate = require('../../../../core/frontend/meta/published-date');
|
||||
|
||||
describe('getPublishedDate', function () {
|
||||
it('should return published at date as ISO 8601 from context if exists', function () {
|
@ -1,7 +1,7 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const routing = require('../../../core/frontend/services/routing');
|
||||
const getRssUrl = require('../../../core/frontend/meta/rss-url');
|
||||
const routing = require('../../../../core/frontend/services/routing');
|
||||
const getRssUrl = require('../../../../core/frontend/meta/rss-url');
|
||||
|
||||
describe('getRssUrl', function () {
|
||||
beforeEach(function () {
|
@ -1,6 +1,6 @@
|
||||
const should = require('should');
|
||||
const getSchema = require('../../../core/frontend/meta/schema');
|
||||
const markdownToMobiledoc = require('../../utils/fixtures/data-generator').markdownToMobiledoc;
|
||||
const getSchema = require('../../../../core/frontend/meta/schema');
|
||||
const markdownToMobiledoc = require('../../../utils/fixtures/data-generator').markdownToMobiledoc;
|
||||
|
||||
describe('getSchema', function () {
|
||||
it('should return post schema if context starts with post', function (done) {
|
@ -1,5 +1,5 @@
|
||||
const should = require('should');
|
||||
const getStructuredData = require('../../../core/frontend/meta/structured-data');
|
||||
const getStructuredData = require('../../../../core/frontend/meta/structured-data');
|
||||
|
||||
describe('getStructuredData', function () {
|
||||
it('should return structured data from metadata per post', function (done) {
|
@ -1,7 +1,7 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const getTitle = require('../../../core/frontend/meta/title');
|
||||
const settingsCache = require('../../../core/shared/settings-cache');
|
||||
const getTitle = require('../../../../core/frontend/meta/title');
|
||||
const settingsCache = require('../../../../core/shared/settings-cache');
|
||||
|
||||
describe('getTitle', function () {
|
||||
let localSettingsCache = {};
|
@ -1,7 +1,7 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const getTwitterImage = require('../../../core/frontend/meta/twitter-image');
|
||||
const settingsCache = require('../../../core/shared/settings-cache');
|
||||
const getTwitterImage = require('../../../../core/frontend/meta/twitter-image');
|
||||
const settingsCache = require('../../../../core/shared/settings-cache');
|
||||
|
||||
describe('getTwitterImage', function () {
|
||||
let localSettingsCache = {};
|
@ -1,9 +1,9 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const urlUtils = require('../../../core/shared/url-utils');
|
||||
const urlService = require('../../../core/frontend/services/url');
|
||||
const getUrl = require('../../../core/frontend/meta/url');
|
||||
const testUtils = require('../../utils');
|
||||
const urlUtils = require('../../../../core/shared/url-utils');
|
||||
const urlService = require('../../../../core/frontend/services/url');
|
||||
const getUrl = require('../../../../core/frontend/meta/url');
|
||||
const testUtils = require('../../../utils');
|
||||
|
||||
describe('getUrl', function () {
|
||||
beforeEach(function () {
|
@ -1,8 +1,8 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const helpers = require('../../../../core/frontend/services/helpers');
|
||||
const AppProxy = require('../../../../core/frontend/services/apps/proxy');
|
||||
const routing = require('../../../../core/frontend/services/routing');
|
||||
const helpers = require('../../../../../core/frontend/services/helpers');
|
||||
const AppProxy = require('../../../../../core/frontend/services/apps/proxy');
|
||||
const routing = require('../../../../../core/frontend/services/routing');
|
||||
|
||||
describe('Apps', function () {
|
||||
beforeEach(function () {
|
@ -1,10 +1,10 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const express = require('../../../../core/shared/express')._express;
|
||||
const settingsCache = require('../../../../core/shared/settings-cache');
|
||||
const events = require('../../../../core/server/lib/common/events');
|
||||
const controllers = require('../../../../core/frontend/services/routing/controllers');
|
||||
const CollectionRouter = require('../../../../core/frontend/services/routing/CollectionRouter');
|
||||
const express = require('../../../../../core/shared/express')._express;
|
||||
const settingsCache = require('../../../../../core/shared/settings-cache');
|
||||
const events = require('../../../../../core/server/lib/common/events');
|
||||
const controllers = require('../../../../../core/frontend/services/routing/controllers');
|
||||
const CollectionRouter = require('../../../../../core/frontend/services/routing/CollectionRouter');
|
||||
const RESOURCE_CONFIG = {QUERY: {post: {controller: 'posts', resource: 'posts'}}};
|
||||
|
||||
describe('UNIT - services/routing/CollectionRouter', function () {
|
@ -1,9 +1,9 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const configUtils = require('../../../utils/configUtils');
|
||||
const events = require('../../../../core/server/lib/common/events');
|
||||
const urlUtils = require('../../../../core/shared/url-utils');
|
||||
const ParentRouter = require('../../../../core/frontend/services/routing/ParentRouter');
|
||||
const configUtils = require('../../../../utils/configUtils');
|
||||
const events = require('../../../../../core/server/lib/common/events');
|
||||
const urlUtils = require('../../../../../core/shared/url-utils');
|
||||
const ParentRouter = require('../../../../../core/frontend/services/routing/ParentRouter');
|
||||
|
||||
describe('UNIT - services/routing/ParentRouter', function () {
|
||||
let req;
|
@ -1,10 +1,10 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const configUtils = require('../../../utils/configUtils');
|
||||
const events = require('../../../../core/server/lib/common/events');
|
||||
const controllers = require('../../../../core/frontend/services/routing/controllers');
|
||||
const RSSRouter = require('../../../../core/frontend/services/routing/RSSRouter');
|
||||
const urlUtils = require('../../../../core/shared/url-utils');
|
||||
const configUtils = require('../../../../utils/configUtils');
|
||||
const events = require('../../../../../core/server/lib/common/events');
|
||||
const controllers = require('../../../../../core/frontend/services/routing/controllers');
|
||||
const RSSRouter = require('../../../../../core/frontend/services/routing/RSSRouter');
|
||||
const urlUtils = require('../../../../../core/shared/url-utils');
|
||||
|
||||
describe('UNIT - services/routing/RSSRouter', function () {
|
||||
describe('instantiate', function () {
|
@ -1,9 +1,9 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const events = require('../../../../core/server/lib/common/events');
|
||||
const controllers = require('../../../../core/frontend/services/routing/controllers');
|
||||
const StaticRoutesRouter = require('../../../../core/frontend/services/routing/StaticRoutesRouter');
|
||||
const configUtils = require('../../../utils/configUtils');
|
||||
const events = require('../../../../../core/server/lib/common/events');
|
||||
const controllers = require('../../../../../core/frontend/services/routing/controllers');
|
||||
const StaticRoutesRouter = require('../../../../../core/frontend/services/routing/StaticRoutesRouter');
|
||||
const configUtils = require('../../../../utils/configUtils');
|
||||
|
||||
describe('UNIT - services/routing/StaticRoutesRouter', function () {
|
||||
let req;
|
@ -1,13 +1,13 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const _ = require('lodash');
|
||||
const settingsCache = require('../../../../core/shared/settings-cache');
|
||||
const events = require('../../../../core/server/lib/common/events');
|
||||
const controllers = require('../../../../core/frontend/services/routing/controllers');
|
||||
const TaxonomyRouter = require('../../../../core/frontend/services/routing/TaxonomyRouter');
|
||||
const RESOURCE_CONFIG_V2 = require('../../../../core/frontend/services/routing/config/v2');
|
||||
const RESOURCE_CONFIG_CANARY = require('../../../../core/frontend/services/routing/config/canary');
|
||||
const RESOURCE_CONFIG_V3 = require('../../../../core/frontend/services/routing/config/v3');
|
||||
const settingsCache = require('../../../../../core/shared/settings-cache');
|
||||
const events = require('../../../../../core/server/lib/common/events');
|
||||
const controllers = require('../../../../../core/frontend/services/routing/controllers');
|
||||
const TaxonomyRouter = require('../../../../../core/frontend/services/routing/TaxonomyRouter');
|
||||
const RESOURCE_CONFIG_V2 = require('../../../../../core/frontend/services/routing/config/v2');
|
||||
const RESOURCE_CONFIG_CANARY = require('../../../../../core/frontend/services/routing/config/canary');
|
||||
const RESOURCE_CONFIG_V3 = require('../../../../../core/frontend/services/routing/config/v3');
|
||||
|
||||
describe('UNIT - services/routing/TaxonomyRouter', function () {
|
||||
let req;
|
@ -1,11 +1,11 @@
|
||||
const errors = require('@tryghost/errors');
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const testUtils = require('../../../../utils');
|
||||
const testUtils = require('../../../../../utils');
|
||||
const security = require('@tryghost/security');
|
||||
const themeEngine = require('../../../../../core/frontend/services/theme-engine');
|
||||
const controllers = require('../../../../../core/frontend/services/routing/controllers');
|
||||
const helpers = require('../../../../../core/frontend/services/routing/helpers');
|
||||
const themeEngine = require('../../../../../../core/frontend/services/theme-engine');
|
||||
const controllers = require('../../../../../../core/frontend/services/routing/controllers');
|
||||
const helpers = require('../../../../../../core/frontend/services/routing/helpers');
|
||||
|
||||
function failTest(done) {
|
||||
return function (err) {
|
@ -1,12 +1,12 @@
|
||||
const errors = require('@tryghost/errors');
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const testUtils = require('../../../../utils');
|
||||
const testUtils = require('../../../../../utils');
|
||||
const security = require('@tryghost/security');
|
||||
const themeEngine = require('../../../../../core/frontend/services/theme-engine');
|
||||
const urlService = require('../../../../../core/frontend/services/url');
|
||||
const controllers = require('../../../../../core/frontend/services/routing/controllers');
|
||||
const helpers = require('../../../../../core/frontend/services/routing/helpers');
|
||||
const themeEngine = require('../../../../../../core/frontend/services/theme-engine');
|
||||
const urlService = require('../../../../../../core/frontend/services/url');
|
||||
const controllers = require('../../../../../../core/frontend/services/routing/controllers');
|
||||
const helpers = require('../../../../../../core/frontend/services/routing/helpers');
|
||||
|
||||
function failTest(done) {
|
||||
return function (err) {
|
@ -1,11 +1,11 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const testUtils = require('../../../../utils');
|
||||
const configUtils = require('../../../../utils/configUtils');
|
||||
const urlService = require('../../../../../core/frontend/services/url');
|
||||
const urlUtils = require('../../../../../core/shared/url-utils');
|
||||
const controllers = require('../../../../../core/frontend/services/routing/controllers');
|
||||
const helpers = require('../../../../../core/frontend/services/routing/helpers');
|
||||
const testUtils = require('../../../../../utils');
|
||||
const configUtils = require('../../../../../utils/configUtils');
|
||||
const urlService = require('../../../../../../core/frontend/services/url');
|
||||
const urlUtils = require('../../../../../../core/shared/url-utils');
|
||||
const controllers = require('../../../../../../core/frontend/services/routing/controllers');
|
||||
const helpers = require('../../../../../../core/frontend/services/routing/helpers');
|
||||
const EDITOR_URL = `/#/editor/post/`;
|
||||
|
||||
describe('Unit - services/routing/controllers/entry', function () {
|
@ -1,13 +1,13 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const Promise = require('bluebird');
|
||||
const testUtils = require('../../../../utils');
|
||||
const configUtils = require('../../../../utils/configUtils');
|
||||
const api = require('../../../../../core/server/api');
|
||||
const controllers = require('../../../../../core/frontend/services/routing/controllers');
|
||||
const helpers = require('../../../../../core/frontend/services/routing/helpers');
|
||||
const urlService = require('../../../../../core/frontend/services/url');
|
||||
const urlUtils = require('../../../../../core/shared/url-utils');
|
||||
const testUtils = require('../../../../../utils');
|
||||
const configUtils = require('../../../../../utils/configUtils');
|
||||
const api = require('../../../../../../core/server/api');
|
||||
const controllers = require('../../../../../../core/frontend/services/routing/controllers');
|
||||
const helpers = require('../../../../../../core/frontend/services/routing/helpers');
|
||||
const urlService = require('../../../../../../core/frontend/services/url');
|
||||
const urlUtils = require('../../../../../../core/shared/url-utils');
|
||||
const EDITOR_URL = '/#/editor/post/';
|
||||
|
||||
describe('Unit - services/routing/controllers/preview', function () {
|
@ -1,10 +1,10 @@
|
||||
const sinon = require('sinon');
|
||||
const testUtils = require('../../../../utils');
|
||||
const testUtils = require('../../../../../utils');
|
||||
const security = require('@tryghost/security');
|
||||
const settingsCache = require('../../../../../core/shared/settings-cache');
|
||||
const controllers = require('../../../../../core/frontend/services/routing/controllers');
|
||||
const helpers = require('../../../../../core/frontend/services/routing/helpers');
|
||||
const rssService = require('../../../../../core/frontend/services/rss');
|
||||
const settingsCache = require('../../../../../../core/shared/settings-cache');
|
||||
const controllers = require('../../../../../../core/frontend/services/routing/controllers');
|
||||
const helpers = require('../../../../../../core/frontend/services/routing/helpers');
|
||||
const rssService = require('../../../../../../core/frontend/services/rss');
|
||||
|
||||
// Helper function to prevent unit tests
|
||||
// from failing via timeout when they
|
@ -1,10 +1,10 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const testUtils = require('../../../../utils');
|
||||
const api = require('../../../../../core/server/api');
|
||||
const themeEngine = require('../../../../../core/frontend/services/theme-engine');
|
||||
const helpers = require('../../../../../core/frontend/services/routing/helpers');
|
||||
const controllers = require('../../../../../core/frontend/services/routing/controllers');
|
||||
const testUtils = require('../../../../../utils');
|
||||
const api = require('../../../../../../core/server/api');
|
||||
const themeEngine = require('../../../../../../core/frontend/services/theme-engine');
|
||||
const helpers = require('../../../../../../core/frontend/services/routing/helpers');
|
||||
const controllers = require('../../../../../../core/frontend/services/routing/controllers');
|
||||
|
||||
function failTest(done) {
|
||||
return function (err) {
|
@ -1,9 +1,9 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const _ = require('lodash');
|
||||
const testUtils = require('../../../../utils');
|
||||
const helpers = require('../../../../../core/frontend/services/routing/helpers');
|
||||
const labs = require('../../../../../core/shared/labs');
|
||||
const testUtils = require('../../../../../utils');
|
||||
const helpers = require('../../../../../../core/frontend/services/routing/helpers');
|
||||
const labs = require('../../../../../../core/shared/labs');
|
||||
|
||||
describe('Contexts', function () {
|
||||
let req;
|
@ -1,9 +1,9 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const Promise = require('bluebird');
|
||||
const testUtils = require('../../../../utils');
|
||||
const api = require('../../../../../core/server/api');
|
||||
const helpers = require('../../../../../core/frontend/services/routing/helpers');
|
||||
const testUtils = require('../../../../../utils');
|
||||
const api = require('../../../../../../core/server/api');
|
||||
const helpers = require('../../../../../../core/frontend/services/routing/helpers');
|
||||
|
||||
describe('Unit - services/routing/helpers/entry-lookup', function () {
|
||||
let locals;
|
@ -1,7 +1,7 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const errors = require('@tryghost/errors');
|
||||
const helpers = require('../../../../../core/frontend/services/routing/helpers');
|
||||
const helpers = require('../../../../../../core/frontend/services/routing/helpers');
|
||||
|
||||
describe('handleError', function () {
|
||||
let next;
|
@ -1,8 +1,8 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const api = require('../../../../../core/server/api').v2;
|
||||
const helpers = require('../../../../../core/frontend/services/routing/helpers');
|
||||
const testUtils = require('../../../../utils');
|
||||
const api = require('../../../../../../core/server/api').v2;
|
||||
const helpers = require('../../../../../../core/frontend/services/routing/helpers');
|
||||
const testUtils = require('../../../../../utils');
|
||||
|
||||
describe('Unit - services/routing/helpers/fetch-data', function () {
|
||||
let posts;
|
@ -1,7 +1,7 @@
|
||||
const should = require('should');
|
||||
const testUtils = require('../../../../utils');
|
||||
const helpers = require('../../../../../core/frontend/services/routing/helpers');
|
||||
const {SafeString} = require('../../../../../core/frontend/services/rendering');
|
||||
const testUtils = require('../../../../../utils');
|
||||
const helpers = require('../../../../../../core/frontend/services/routing/helpers');
|
||||
const {SafeString} = require('../../../../../../core/frontend/services/rendering');
|
||||
|
||||
describe('Unit - services/routing/helpers/format-response', function () {
|
||||
let posts;
|
@ -1,8 +1,8 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const rewire = require('rewire');
|
||||
const templates = rewire('../../../../../core/frontend/services/routing/helpers/templates');
|
||||
const themeEngine = require('../../../../../core/frontend/services/theme-engine');
|
||||
const templates = rewire('../../../../../../core/frontend/services/routing/helpers/templates');
|
||||
const themeEngine = require('../../../../../../core/frontend/services/theme-engine');
|
||||
|
||||
describe('templates', function () {
|
||||
let getActiveThemeStub;
|
@ -1,8 +1,8 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const errors = require('@tryghost/errors');
|
||||
const urlUtils = require('../../../../../core/shared/url-utils');
|
||||
const middlewares = require('../../../../../core/frontend/services/routing/middlewares');
|
||||
const urlUtils = require('../../../../../../core/shared/url-utils');
|
||||
const middlewares = require('../../../../../../core/frontend/services/routing/middlewares');
|
||||
|
||||
describe('UNIT: services/routing/middlewares/page-param', function () {
|
||||
let req;
|
@ -1,7 +1,7 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const rewire = require('rewire');
|
||||
const registry = rewire('../../../../core/frontend/services/routing/registry');
|
||||
const registry = rewire('../../../../../core/frontend/services/routing/registry');
|
||||
|
||||
describe('UNIT: services/routing/registry', function () {
|
||||
let getRssUrlStub;
|
@ -1,8 +1,8 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const rewire = require('rewire');
|
||||
const configUtils = require('../../../utils/configUtils');
|
||||
const rssCache = rewire('../../../../core/frontend/services/rss/cache');
|
||||
const configUtils = require('../../../../utils/configUtils');
|
||||
const rssCache = rewire('../../../../../core/frontend/services/rss/cache');
|
||||
|
||||
describe('RSS: Cache', function () {
|
||||
let generateSpy;
|
@ -1,10 +1,10 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const _ = require('lodash');
|
||||
const testUtils = require('../../../utils');
|
||||
const configUtils = require('../../../utils/configUtils');
|
||||
const urlService = require('../../../../core/frontend/services/url');
|
||||
const generateFeed = require('../../../../core/frontend/services/rss/generate-feed');
|
||||
const testUtils = require('../../../../utils');
|
||||
const configUtils = require('../../../../utils/configUtils');
|
||||
const urlService = require('../../../../../core/frontend/services/url');
|
||||
const generateFeed = require('../../../../../core/frontend/services/rss/generate-feed');
|
||||
|
||||
describe('RSS: Generate Feed', function () {
|
||||
const data = {};
|
@ -1,8 +1,8 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const Promise = require('bluebird');
|
||||
const rssCache = require('../../../../core/frontend/services/rss/cache');
|
||||
const renderer = require('../../../../core/frontend/services/rss/renderer');
|
||||
const rssCache = require('../../../../../core/frontend/services/rss/cache');
|
||||
const renderer = require('../../../../../core/frontend/services/rss/renderer');
|
||||
|
||||
describe('RSS: Renderer', function () {
|
||||
let rssCacheStub;
|
@ -2,13 +2,13 @@ const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const ObjectId = require('bson-objectid');
|
||||
const _ = require('lodash');
|
||||
const testUtils = require('../../../utils');
|
||||
const urlUtils = require('../../../../core/shared/url-utils');
|
||||
const IndexGenerator = require('../../../../core/frontend/services/sitemap/index-generator');
|
||||
const PostGenerator = require('../../../../core/frontend/services/sitemap/post-generator');
|
||||
const PageGenerator = require('../../../../core/frontend/services/sitemap/page-generator');
|
||||
const TagGenerator = require('../../../../core/frontend/services/sitemap/tag-generator');
|
||||
const UserGenerator = require('../../../../core/frontend/services/sitemap/user-generator');
|
||||
const testUtils = require('../../../../utils');
|
||||
const urlUtils = require('../../../../../core/shared/url-utils');
|
||||
const IndexGenerator = require('../../../../../core/frontend/services/sitemap/index-generator');
|
||||
const PostGenerator = require('../../../../../core/frontend/services/sitemap/post-generator');
|
||||
const PageGenerator = require('../../../../../core/frontend/services/sitemap/page-generator');
|
||||
const TagGenerator = require('../../../../../core/frontend/services/sitemap/tag-generator');
|
||||
const UserGenerator = require('../../../../../core/frontend/services/sitemap/user-generator');
|
||||
|
||||
should.Assertion.add('ValidUrlNode', function (options) {
|
||||
// Check urlNode looks correct
|
@ -2,14 +2,14 @@ const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
|
||||
// Stuff we are testing
|
||||
const events = require('../../../../core/server/lib/common/events');
|
||||
const events = require('../../../../../core/server/lib/common/events');
|
||||
|
||||
const SiteMapManager = require('../../../../core/frontend/services/sitemap/manager');
|
||||
const PostGenerator = require('../../../../core/frontend/services/sitemap/post-generator');
|
||||
const PageGenerator = require('../../../../core/frontend/services/sitemap/page-generator');
|
||||
const TagGenerator = require('../../../../core/frontend/services/sitemap/tag-generator');
|
||||
const UserGenerator = require('../../../../core/frontend/services/sitemap/user-generator');
|
||||
const IndexGenerator = require('../../../../core/frontend/services/sitemap/index-generator');
|
||||
const SiteMapManager = require('../../../../../core/frontend/services/sitemap/manager');
|
||||
const PostGenerator = require('../../../../../core/frontend/services/sitemap/post-generator');
|
||||
const PageGenerator = require('../../../../../core/frontend/services/sitemap/page-generator');
|
||||
const TagGenerator = require('../../../../../core/frontend/services/sitemap/tag-generator');
|
||||
const UserGenerator = require('../../../../../core/frontend/services/sitemap/user-generator');
|
||||
const IndexGenerator = require('../../../../../core/frontend/services/sitemap/index-generator');
|
||||
|
||||
describe('Unit: sitemap/manager', function () {
|
||||
let eventsToRemember;
|
@ -1,10 +1,10 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const config = require('../../../../core/shared/config');
|
||||
const config = require('../../../../../core/shared/config');
|
||||
|
||||
// is only exposed via themeEngine.getActive()
|
||||
const activeTheme = require('../../../../core/frontend/services/theme-engine/active');
|
||||
const engine = require('../../../../core/frontend/services/theme-engine/engine');
|
||||
const activeTheme = require('../../../../../core/frontend/services/theme-engine/active');
|
||||
const engine = require('../../../../../core/frontend/services/theme-engine/engine');
|
||||
|
||||
describe('Themes', function () {
|
||||
afterEach(function () {
|
@ -1,6 +1,6 @@
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const themeConfig = require('../../../../core/frontend/services/theme-engine/config');
|
||||
const themeConfig = require('../../../../../core/frontend/services/theme-engine/config');
|
||||
|
||||
describe('Themes', function () {
|
||||
afterEach(function () {
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user