Removed unused test utils

refs https://github.com/TryGhost/Toolbox/issues/129

- These have been substituted by e2e-framework module
This commit is contained in:
Naz 2021-12-09 13:05:56 +04:00 committed by naz
parent eb35c64f19
commit 307e4c2643

View File

@ -1,9 +1,5 @@
const url = require('url');
const _ = require('lodash');
const supertest = require('supertest');
const testUtils = require('../../../../utils');
const fixtures = require('../../../../utils/fixture-utils');
const {sequence} = require('@tryghost/promise');
const API_URL = '/ghost/api/canary/admin/';
@ -216,35 +212,6 @@ module.exports = {
return await testUtils.startGhost(Object.assign(defaults, overrides));
},
async getAgent({forceStart} = {}) {
const app = await this.startGhost({forceStart});
return supertest.agent(app);
},
async login(request) {
return testUtils.API.login(request, `${API_URL}session/`);
},
async getAuthenticatedAgent({forceStart} = {}) {
const request = await this.getAgent({forceStart});
await this.login(request);
return request;
},
async initFixtures(...options) {
// No DB setup, but override the owner
options = _.merge({'owner:post': true}, _.transform(options, function (result, val) {
if (val) {
result[val] = true;
}
}));
const fixtureOps = fixtures.getFixtureOps(options);
return sequence(fixtureOps);
},
getValidAdminToken(endpoint, key) {
const jwt = require('jsonwebtoken');
key = key || testUtils.DataGenerator.Content.api_keys[0];