mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1022 B
42 lines
1022 B
/*
|
|
* Squidex Headless CMS
|
|
*
|
|
* @license
|
|
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
|
|
*/
|
|
|
|
import { TempService, TempServiceFactory } from './temp.service';
|
|
|
|
describe('TempService', () => {
|
|
it('should instantiate from factory', () => {
|
|
const tempService = TempServiceFactory();
|
|
|
|
expect(tempService).toBeDefined();
|
|
});
|
|
|
|
it('should instantiate', () => {
|
|
const tempService = new TempService();
|
|
|
|
expect(tempService).toBeDefined();
|
|
});
|
|
|
|
it('should return null when nothing is stored', () => {
|
|
const tempService = new TempService();
|
|
|
|
const temp = tempService.fetch();
|
|
|
|
expect(temp).toBeNull();
|
|
});
|
|
|
|
it('should return value once when something is stored', () => {
|
|
const tempService = new TempService();
|
|
|
|
tempService.put('Hello');
|
|
|
|
const temp1 = tempService.fetch();
|
|
const temp2 = tempService.fetch();
|
|
|
|
expect(temp1).toBe('Hello');
|
|
expect(temp2).toBeNull();
|
|
});
|
|
});
|
|
|