Merge pull request #83 from thecodingmachine/cleanup_rename_frame

Cleanup: renaming "frame" to "character"
This commit is contained in:
David Négrier 2020-05-08 16:21:16 +02:00 committed by GitHub
commit c59d693f6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 49 additions and 49 deletions

View file

@ -3,18 +3,18 @@ import {Message} from "../src/Model/Websocket/Message";
describe("Message Model", () => {
it("should find userId and roomId", () => {
let message = {userId: "test1", roomId: "test2", name: "foo", frame: "user"};
let message = {userId: "test1", roomId: "test2", name: "foo", character: "user"};
let messageObject = new Message(message);
expect(messageObject.userId).toBe("test1");
expect(messageObject.roomId).toBe("test2");
expect(messageObject.name).toBe("foo");
expect(messageObject.frame).toBe("user");
expect(messageObject.character).toBe("user");
})
it("should expose a toJson method", () => {
let message = {userId: "test1", roomId: "test2", name: "foo", frame: "user"};
let message = {userId: "test1", roomId: "test2", name: "foo", character: "user"};
let messageObject = new Message(message);
expect(messageObject.toJson()).toEqual({userId: "test1", roomId: "test2", name: "foo", frame: "user"});
expect(messageObject.toJson()).toEqual({userId: "test1", roomId: "test2", name: "foo", character: "user"});
});
it("should find throw error when no userId", () => {
@ -37,4 +37,4 @@ describe("Message Model", () => {
let messageObject = new Message(message);
}).toThrow(new Error("userId or roomId cannot be null"));
});
})
})