mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 14:17:22 +01:00
Move Chat to Model (#9703)
* Began moving group chat to separate model * Fixed lint issue * Updated delete chat with new model * Updated flag chat to support model * Updated like chat to use model * Fixed duplicate code and chat messages * Added note about concat chat * Updated clear flags to user new model * Updated more chat checks when loading get group * Fixed spell test and back save * Moved get chat to json method * Updated flagging with new chat model * Added missing await * Fixed chat user styles. Fixed spell group test * Added new model to quest chat and group plan chat * Removed extra timestamps. Added limit check for group plans * Updated tests * Synced id fields * Fixed id creation * Add meta and fixed tests * Fixed group quest accept test * Updated puppeteer * Added migration * Export vars * Updated comments
This commit is contained in:
committed by
Sabe Jones
parent
0ec1a91774
commit
7d7fe6047c
@@ -5,6 +5,7 @@ import {
|
||||
} from '../../../../helpers/api-v3-integration.helper';
|
||||
import { v4 as generateUUID } from 'uuid';
|
||||
import { quests as questScrolls } from '../../../../../website/common/script/content';
|
||||
import { model as Chat } from '../../../../../website/server/models/chat';
|
||||
|
||||
describe('POST /groups/:groupId/quests/invite/:questKey', () => {
|
||||
let questingGroup;
|
||||
@@ -199,11 +200,11 @@ describe('POST /groups/:groupId/quests/invite/:questKey', () => {
|
||||
|
||||
await groupLeader.post(`/groups/${group._id}/quests/invite/${PET_QUEST}`);
|
||||
|
||||
await group.sync();
|
||||
const groupChat = await Chat.find({ groupId: group._id }).exec();
|
||||
|
||||
expect(group.chat[0].text).to.exist;
|
||||
expect(group.chat[0]._meta).to.exist;
|
||||
expect(group.chat[0]._meta).to.have.all.keys(['participatingMembers']);
|
||||
expect(groupChat[0].text).to.exist;
|
||||
expect(groupChat[0]._meta).to.exist;
|
||||
expect(groupChat[0]._meta).to.have.all.keys(['participatingMembers']);
|
||||
|
||||
let returnedGroup = await groupLeader.get(`/groups/${group._id}`);
|
||||
expect(returnedGroup.chat[0]._meta).to.be.undefined;
|
||||
|
||||
Reference in New Issue
Block a user