# All files / src/lib/services/chat chat.service.mock.ts

90.47% Statements 19/21
45.45% Branches 10/22
37.5% Functions 3/8
93.33% Lines 14/15

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    411x
    1x
    1x
    1x
    1x

    1x

    4x
    4x
    4x
    4x
    4x
    4x

    1x
    1x

     import { Injectable } from '@angular/core';
    import { Observable, BehaviorSubject } from 'rxjs';
    impoIrt { ChatMessage } from '../../models/chat.model';

    @Injectable()
    export class ChatServiceMock {
    	messagesObs: Observable<ChatMessage[]>;
    	messagesUnreadObs: Observable<number>;
    	toggleChatObs: Observable<boolean>;
    	private _messageList = <BehaviorSubject<ChatMessage[]>>new BehaviorSubject([]);
    	private _toggleChat = <BehaviorSubject<boolean>>new BehaviorSubject(false);

    	private _messagesUnread = <BehaviorSubject<number>>new BehaviorSubject(0);

    	constructor() {
    		this.messagesObs = this._messageList.asObservable();
    		this.toggleChatObs = this._toggleChat.asObservable();
    		this.messagesUnreadObs = this._messagesUnread.asObservable();
    	}

    	subscribeToChat() {
    	}

    	sendMessage(message: string) {

    	}

    	toggleChat() {

    	}

    	private isChatOpened(): boolean {
    		return false;
    	}

    	private addMessageUnread() {

    	}
    }