0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Fixed adapter-related unit test

refs 37dd187fe6
refs c36575627d/ghost/core/core/server/data/importer/handlers/image.js (L16)

- The tests were failing because they were stubbing a "generic" adapter, instead of the one which the module under test was using (see referenced code to see what I mean)
This commit is contained in:
Naz 2022-09-06 18:46:32 +08:00
parent c36575627d
commit 920a3aeb4c
No known key found for this signature in database
2 changed files with 4 additions and 4 deletions

View file

@ -481,7 +481,7 @@ describe('Importer', function () {
}); });
describe('ImageHandler', function () { describe('ImageHandler', function () {
const store = storage.getStorage(); const store = storage.getStorage('images');
it('has the correct interface', function () { it('has the correct interface', function () {
ImageHandler.type.should.eql('images'); ImageHandler.type.should.eql('images');

View file

@ -271,7 +271,7 @@ describe('lib/mobiledoc', function () {
}); });
it('does not render srcsets with incompatible storage engine', function () { it('does not render srcsets with incompatible storage engine', function () {
sinon.stub(storage.getStorage(), 'saveRaw').value(null); sinon.stub(storage.getStorage('images'), 'saveRaw').value(null);
let mobiledoc = { let mobiledoc = {
version: '0.3.1', version: '0.3.1',
@ -299,11 +299,11 @@ describe('lib/mobiledoc', function () {
beforeEach(function () { beforeEach(function () {
originalStoragePath = storage.getStorage().storagePath; originalStoragePath = storage.getStorage().storagePath;
storage.getStorage().storagePath = path.join(__dirname, '../../../utils/fixtures/images/'); storage.getStorage('images').storagePath = path.join(__dirname, '../../../utils/fixtures/images/');
}); });
afterEach(function () { afterEach(function () {
storage.getStorage().storagePath = originalStoragePath; storage.getStorage('images').storagePath = originalStoragePath;
}); });
it('works', async function () { it('works', async function () {