Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe("`lateMessage`", () => {
- let fakeKonversation, localView, message;
- beforeEach(() => {
- fakeKonversation = Konversation.extend({
- chat_presenter: jest.fn(message => ({
- render: jest.fn(param => ({
- el: "DIV"
- }))
- }))
- });
- localView = new fakeKonversation(params);
- localView.$el.append(`<div class=chat-messages></div>`);
- });
- describe("should do stuff if `view.late` is `true`", () => {
- it("should call `chat_presenter` with `message`", () => {
- localView.late = true;
- localView.lateMessage("This is a late message");
- expect(localView.chat_presenter.mock.calls.length).toBe(1);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement