import { buildCustomStorage } from '../src/Storage'
import { buildCustomStoragesMap } from '../src/Storage'

const expect = require('chai').expect

describe('Storage', function() {
  let newStorage = buildCustomStorage('fileSystem', ()=>{}, ()=>{}, ()=>{})
  describe('#buildCustomStorage()', function() {
    it('should build the custom storage', function() {
        expect(newStorage).to.have.property('fileSystem')
        expect(newStorage.fileSystem).to.have.property('setValue')
        expect(newStorage.fileSystem.setValue).to.be.a('function')
    });
  });
  describe('#buildCustomStoragesMap()', function() {
    let customStoragesMap = buildCustomStoragesMap('fileSystem', newStorage)
    it('should build the custom storage map', function() {
        expect(customStoragesMap).to.have.property('fileSystem')
        expect(customStoragesMap).to.have.property('cookie')
        expect(customStoragesMap.fileSystem.setValue).to.be.a('function')
    });
  });
});

@@ -100,16 +100,53 @@
 Storage'
+%0Aimport Storage from '../src/Storage'
 %0A%0Aconst 
@@ -287,16 +287,91 @@
 ()=%3E%7B%7D)%0A
+  let customStoragesMap = buildCustomStoragesMap('fileSystem', newStorage)%0A
   descri
@@ -729,85 +729,8 @@
 ) %7B%0A
-    let customStoragesMap = buildCustomStoragesMap('fileSystem', newStorage)%0A
     
@@ -992,18 +992,283 @@
     %7D);%0A
-
   %7D);%0A
+  describe('#Storage', function()%7B%0A    it('should add custom storage to Storage instance', function()%7B%0A      let storage = new Storage('fileSystem', newStorage, customStoragesMap)%0A      expect(storage.STORAGES_MAP).to.have.property('fileSystem')       %0A    %7D)%0A  %7D)%0A
 %7D);%0A

test storage instance having custom storages map