@@ -4,14 +4,14 @@ const FilesAdapter = require('../lib/Adapters/Files/FilesAdapter').default;
4
4
const FilesController = require ( '../lib/Controllers/FilesController' )
5
5
. FilesController ;
6
6
7
- const MockController = function ( options ) {
7
+ const MockController = function ( options ) {
8
8
AdaptableController . call ( this , options ) ;
9
9
} ;
10
10
MockController . prototype = Object . create ( AdaptableController . prototype ) ;
11
11
MockController . prototype . constructor = AdaptableController ;
12
12
13
13
describe ( 'AdaptableController' , ( ) => {
14
- it ( 'should use the provided adapter' , done => {
14
+ it ( 'should use the provided adapter' , ( done ) => {
15
15
const adapter = new FilesAdapter ( ) ;
16
16
const controller = new FilesController ( adapter ) ;
17
17
expect ( controller . adapter ) . toBe ( adapter ) ;
@@ -23,15 +23,15 @@ describe('AdaptableController', () => {
23
23
done ( ) ;
24
24
} ) ;
25
25
26
- it ( 'should throw when creating a new mock controller' , done => {
26
+ it ( 'should throw when creating a new mock controller' , ( done ) => {
27
27
const adapter = new FilesAdapter ( ) ;
28
28
expect ( ( ) => {
29
29
new MockController ( adapter ) ;
30
30
} ) . toThrow ( ) ;
31
31
done ( ) ;
32
32
} ) ;
33
33
34
- it ( 'should fail setting the wrong adapter to the controller' , done => {
34
+ it ( 'should fail setting the wrong adapter to the controller' , ( done ) => {
35
35
function WrongAdapter ( ) { }
36
36
const adapter = new FilesAdapter ( ) ;
37
37
const controller = new FilesController ( adapter ) ;
@@ -42,7 +42,7 @@ describe('AdaptableController', () => {
42
42
done ( ) ;
43
43
} ) ;
44
44
45
- it ( 'should fail to instantiate a controller with wrong adapter' , done => {
45
+ it ( 'should fail to instantiate a controller with wrong adapter' , ( done ) => {
46
46
function WrongAdapter ( ) { }
47
47
const adapter = new WrongAdapter ( ) ;
48
48
expect ( ( ) => {
@@ -51,34 +51,36 @@ describe('AdaptableController', () => {
51
51
done ( ) ;
52
52
} ) ;
53
53
54
- it ( 'should fail to instantiate a controller without an adapter' , done => {
54
+ it ( 'should fail to instantiate a controller without an adapter' , ( done ) => {
55
55
expect ( ( ) => {
56
56
new FilesController ( ) ;
57
57
} ) . toThrow ( ) ;
58
58
done ( ) ;
59
59
} ) ;
60
60
61
- it ( 'should accept an object adapter' , done => {
61
+ it ( 'should accept an object adapter' , ( done ) => {
62
62
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 ( ) { } ,
68
69
} ;
69
70
expect ( ( ) => {
70
71
new FilesController ( adapter ) ;
71
72
} ) . not . toThrow ( ) ;
72
73
done ( ) ;
73
74
} ) ;
74
75
75
- it ( 'should accept an prototype based object adapter' , done => {
76
+ it ( 'should accept an prototype based object adapter' , ( done ) => {
76
77
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 ( ) { } ;
82
84
83
85
const adapter = new AGoodAdapter ( ) ;
84
86
expect ( ( ) => {
0 commit comments