Skip to content

Commit 7706da1

Browse files
committed
fix tests
1 parent b2f002d commit 7706da1

File tree

3 files changed

+414
-379
lines changed

3 files changed

+414
-379
lines changed

spec/AdaptableController.spec.js

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ const FilesAdapter = require('../lib/Adapters/Files/FilesAdapter').default;
44
const FilesController = require('../lib/Controllers/FilesController')
55
.FilesController;
66

7-
const MockController = function(options) {
7+
const MockController = function (options) {
88
AdaptableController.call(this, options);
99
};
1010
MockController.prototype = Object.create(AdaptableController.prototype);
1111
MockController.prototype.constructor = AdaptableController;
1212

1313
describe('AdaptableController', () => {
14-
it('should use the provided adapter', done => {
14+
it('should use the provided adapter', (done) => {
1515
const adapter = new FilesAdapter();
1616
const controller = new FilesController(adapter);
1717
expect(controller.adapter).toBe(adapter);
@@ -23,15 +23,15 @@ describe('AdaptableController', () => {
2323
done();
2424
});
2525

26-
it('should throw when creating a new mock controller', done => {
26+
it('should throw when creating a new mock controller', (done) => {
2727
const adapter = new FilesAdapter();
2828
expect(() => {
2929
new MockController(adapter);
3030
}).toThrow();
3131
done();
3232
});
3333

34-
it('should fail setting the wrong adapter to the controller', done => {
34+
it('should fail setting the wrong adapter to the controller', (done) => {
3535
function WrongAdapter() {}
3636
const adapter = new FilesAdapter();
3737
const controller = new FilesController(adapter);
@@ -42,7 +42,7 @@ describe('AdaptableController', () => {
4242
done();
4343
});
4444

45-
it('should fail to instantiate a controller with wrong adapter', done => {
45+
it('should fail to instantiate a controller with wrong adapter', (done) => {
4646
function WrongAdapter() {}
4747
const adapter = new WrongAdapter();
4848
expect(() => {
@@ -51,34 +51,36 @@ describe('AdaptableController', () => {
5151
done();
5252
});
5353

54-
it('should fail to instantiate a controller without an adapter', done => {
54+
it('should fail to instantiate a controller without an adapter', (done) => {
5555
expect(() => {
5656
new FilesController();
5757
}).toThrow();
5858
done();
5959
});
6060

61-
it('should accept an object adapter', done => {
61+
it('should accept an object adapter', (done) => {
6262
const adapter = {
63-
createFile: function() {},
64-
deleteFile: function() {},
65-
getFileData: function() {},
66-
getFileLocation: function() {},
67-
validateFilename: function() {},
63+
createFile: function () {},
64+
deleteFile: function () {},
65+
getFileData: function () {},
66+
getMetadata: function () {},
67+
getFileLocation: function () {},
68+
validateFilename: function () {},
6869
};
6970
expect(() => {
7071
new FilesController(adapter);
7172
}).not.toThrow();
7273
done();
7374
});
7475

75-
it('should accept an prototype based object adapter', done => {
76+
it('should accept an prototype based object adapter', (done) => {
7677
function AGoodAdapter() {}
77-
AGoodAdapter.prototype.createFile = function() {};
78-
AGoodAdapter.prototype.deleteFile = function() {};
79-
AGoodAdapter.prototype.getFileData = function() {};
80-
AGoodAdapter.prototype.getFileLocation = function() {};
81-
AGoodAdapter.prototype.validateFilename = function() {};
78+
AGoodAdapter.prototype.createFile = function () {};
79+
AGoodAdapter.prototype.deleteFile = function () {};
80+
AGoodAdapter.prototype.getFileData = function () {};
81+
AGoodAdapter.prototype.getMetadata = function () {};
82+
AGoodAdapter.prototype.getFileLocation = function () {};
83+
AGoodAdapter.prototype.validateFilename = function () {};
8284

8385
const adapter = new AGoodAdapter();
8486
expect(() => {

0 commit comments

Comments
 (0)