mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-04-13 21:32:55 +00:00
IndexedDbService
This commit is contained in:
parent
014cef0697
commit
c87c8f12fb
src/app/shared/services
@ -9,7 +9,13 @@ describe('IndexedDbService', () => {
|
||||
});
|
||||
});
|
||||
|
||||
// it('should be created', inject([IndexedDbService], (service: IndexedDbService) => {
|
||||
// expect(service).toBeTruthy();
|
||||
// }));
|
||||
it('should be created', inject([IndexedDbService], (service: IndexedDbService) => {
|
||||
expect(service).toBeTruthy();
|
||||
}));
|
||||
|
||||
it('should get AngularIndexedDB', inject([IndexedDbService], (service: IndexedDbService) => {
|
||||
const indexeddb = service.get();
|
||||
expect(indexeddb.dbWrapper.dbName).toEqual(IndexedDbService.DATABASE);
|
||||
expect(indexeddb.dbWrapper.dbVersion).toEqual(IndexedDbService.VERSION);
|
||||
}));
|
||||
});
|
||||
|
@ -3,10 +3,14 @@ import { AngularIndexedDB } from 'angular2-indexeddb';
|
||||
|
||||
@Injectable()
|
||||
export class IndexedDbService {
|
||||
static VERSION = 1;
|
||||
static DATABASE = 'gns3-web-ui';
|
||||
|
||||
private db: AngularIndexedDB;
|
||||
|
||||
constructor() {
|
||||
this.db = new AngularIndexedDB('gns3-web-ui', 1);
|
||||
this.db = new AngularIndexedDB(
|
||||
IndexedDbService.DATABASE, IndexedDbService.VERSION);
|
||||
}
|
||||
|
||||
public get() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user