mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-04-14 19:56:23 +00:00
* Resolves #11861 * Fix unit tests for translation changes * Remove non-en quest.json locales
This commit is contained in:
parent
962f2b7579
commit
6a483edfe1
5 changed files with 8 additions and 6 deletions
|
|
@ -100,7 +100,7 @@ describe('POST /groups/:groupId/quests/accept', () => {
|
|||
.to.eventually.be.rejected.and.eql({
|
||||
code: 401,
|
||||
error: 'NotAuthorized',
|
||||
message: t('questAlreadyUnderway'),
|
||||
message: t('questAlreadyStartedFriendly'),
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ describe('POST /groups/:groupId/quests/force-start', () => {
|
|||
.to.eventually.be.rejected.and.eql({
|
||||
code: 401,
|
||||
error: 'NotAuthorized',
|
||||
message: t('questAlreadyUnderway'),
|
||||
message: t('questAlreadyStarted'),
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ describe('POST /groups/:groupId/quests/reject', () => {
|
|||
.to.eventually.be.rejected.and.eql({
|
||||
code: 401,
|
||||
error: 'NotAuthorized',
|
||||
message: t('questAlreadyUnderway'),
|
||||
message: t('questAlreadyStartedFriendly'),
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -102,6 +102,8 @@
|
|||
"questNotGemPurchasable": "Quest \"<%= key %>\" is not a Gem-purchasable quest.",
|
||||
"questLevelTooHigh": "You must be level <%= level %> to begin this quest.",
|
||||
"questAlreadyUnderway": "Your party is already on a quest. Try again when the current quest has ended.",
|
||||
"questAlreadyStarted": "The quest has already started.",
|
||||
"questAlreadyStartedFriendly": "The quest has already started, but you can always catch the next one!",
|
||||
"questAlreadyAccepted": "You already accepted the quest invitation.",
|
||||
"noActiveQuestToLeave": "No active quest to leave",
|
||||
"questLeaderCannotLeaveQuest": "Quest leader cannot leave quest",
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ api.acceptQuest = {
|
|||
if (!group) throw new NotFound(res.t('groupNotFound'));
|
||||
if (group.type !== 'party') throw new NotAuthorized(res.t('guildQuestsNotSupported'));
|
||||
if (!group.quest.key) throw new NotFound(res.t('questInviteNotFound'));
|
||||
if (group.quest.active) throw new NotAuthorized(res.t('questAlreadyUnderway'));
|
||||
if (group.quest.active) throw new NotAuthorized(res.t('questAlreadyStartedFriendly'));
|
||||
if (group.quest.members[user._id]) throw new BadRequest(res.t('questAlreadyAccepted'));
|
||||
|
||||
user.party.quest.RSVPNeeded = false;
|
||||
|
|
@ -248,7 +248,7 @@ api.rejectQuest = {
|
|||
if (!group) throw new NotFound(res.t('groupNotFound'));
|
||||
if (group.type !== 'party') throw new NotAuthorized(res.t('guildQuestsNotSupported'));
|
||||
if (!group.quest.key) throw new NotFound(res.t('questInvitationDoesNotExist'));
|
||||
if (group.quest.active) throw new NotAuthorized(res.t('questAlreadyUnderway'));
|
||||
if (group.quest.active) throw new NotAuthorized(res.t('questAlreadyStartedFriendly'));
|
||||
if (group.quest.members[user._id]) throw new BadRequest(res.t('questAlreadyAccepted'));
|
||||
if (group.quest.members[user._id] === false) throw new BadRequest(res.t('questAlreadyRejected'));
|
||||
|
||||
|
|
@ -312,7 +312,7 @@ api.forceStart = {
|
|||
if (!group) throw new NotFound(res.t('groupNotFound'));
|
||||
if (group.type !== 'party') throw new NotAuthorized(res.t('guildQuestsNotSupported'));
|
||||
if (!group.quest.key) throw new NotFound(res.t('questNotPending'));
|
||||
if (group.quest.active) throw new NotAuthorized(res.t('questAlreadyUnderway'));
|
||||
if (group.quest.active) throw new NotAuthorized(res.t('questAlreadyStarted'));
|
||||
if (!(user._id === group.quest.leader || user._id === group.leader)) {
|
||||
throw new NotAuthorized(res.t('questOrGroupLeaderOnlyStartQuest'));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue