|
@@ -291,95 +291,6 @@ describe('Filters', function() {
|
|
|
});
|
|
|
});
|
|
|
|
|
|
- describe('dndModeSimplified', function() {
|
|
|
- let process = (dnd, sound) => {
|
|
|
- return $filter('dndModeSimplified')({
|
|
|
- notifications: {
|
|
|
- dnd: dnd,
|
|
|
- sound: sound,
|
|
|
- },
|
|
|
- })
|
|
|
- };
|
|
|
-
|
|
|
- it('dnd enabled', () => {
|
|
|
- expect(process(
|
|
|
- {mode: 'on'},
|
|
|
- {mode: 'default'}
|
|
|
- )).toEqual('on');
|
|
|
- });
|
|
|
-
|
|
|
- it('dnd enabled (no sound)', () => {
|
|
|
- expect(process(
|
|
|
- {mode: 'on'},
|
|
|
- {mode: 'muted'}
|
|
|
- )).toEqual('on');
|
|
|
- });
|
|
|
-
|
|
|
- it('dnd disabled', () => {
|
|
|
- expect(process(
|
|
|
- {mode: 'off'},
|
|
|
- {mode: 'default'}
|
|
|
- )).toEqual('off');
|
|
|
- });
|
|
|
-
|
|
|
- it('dnd disabled (no sound)', () => {
|
|
|
- expect(process(
|
|
|
- {mode: 'off'},
|
|
|
- {mode: 'muted'}
|
|
|
- )).toEqual('off');
|
|
|
- });
|
|
|
-
|
|
|
- it('mention only', () => {
|
|
|
- expect(process(
|
|
|
- {mode: 'on', mentionOnly: true},
|
|
|
- {mode: 'default'}
|
|
|
- )).toEqual('mention');
|
|
|
- });
|
|
|
-
|
|
|
- it('mention only (no sound)', () => {
|
|
|
- expect(process(
|
|
|
- {mode: 'on', mentionOnly: true},
|
|
|
- {mode: 'muted'}
|
|
|
- )).toEqual('mention');
|
|
|
- });
|
|
|
-
|
|
|
- it('until (not expired)', () => {
|
|
|
- jasmine.clock().install();
|
|
|
- jasmine.clock().mockDate(new Date(2018, 9, 9, 20, 42));
|
|
|
- expect(process(
|
|
|
- {mode: 'until', until: +(new Date(2018, 9, 9, 20, 50))},
|
|
|
- {mode: 'default'}
|
|
|
- )).toEqual('on');
|
|
|
- });
|
|
|
-
|
|
|
- it('until (expired)', () => {
|
|
|
- jasmine.clock().install();
|
|
|
- jasmine.clock().mockDate(new Date(2018, 9, 9, 20, 42));
|
|
|
- expect(process(
|
|
|
- {mode: 'until', until: +(new Date(2018, 9, 9, 19, 50))},
|
|
|
- {mode: 'default'}
|
|
|
- )).toEqual('off');
|
|
|
- });
|
|
|
-
|
|
|
- it('until (mention only, not expired)', () => {
|
|
|
- jasmine.clock().install();
|
|
|
- jasmine.clock().mockDate(new Date(2018, 9, 9, 20, 42));
|
|
|
- expect(process(
|
|
|
- {mode: 'until', until: +(new Date(2018, 9, 9, 20, 50)), mentionOnly: true},
|
|
|
- {mode: 'default'}
|
|
|
- )).toEqual('mention');
|
|
|
- });
|
|
|
-
|
|
|
- it('until (mention only, expired)', () => {
|
|
|
- jasmine.clock().install();
|
|
|
- jasmine.clock().mockDate(new Date(2018, 9, 9, 20, 42));
|
|
|
- expect(process(
|
|
|
- {mode: 'until', until: +(new Date(2018, 9, 9, 19, 50)), mentionOnly: true},
|
|
|
- {mode: 'default'}
|
|
|
- )).toEqual('off');
|
|
|
- });
|
|
|
- });
|
|
|
-
|
|
|
describe('enlargeSingleEmoji', function() {
|
|
|
let process = (text) => {
|
|
|
return $filter('enlargeSingleEmoji')(text, true)
|