Skip to content

Commit

Permalink
Fix registration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
futa-ikeda committed Dec 18, 2024
1 parent 1311d6d commit 550042d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion app/preprints/new-version/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export default class PreprintNewVersionRoute extends Route {
const preprint: PreprintModel = await this.store.findRecord('preprint', args.guid);

if (!preprint.canCreateNewVersion) {
// TODO: translate and add message body details
let message = this.intl.t('prperints.submit.new-version.redirect.latest-published',
{ preprintWord: provider.documentType.singular });
if (!preprint.currentUserIsAdmin) {
Expand Down
7 changes: 3 additions & 4 deletions mirage/views/review-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import { HandlerContext, ModelInstance, NormalizedRequestAttrs, Request, Schema
import { PreprintMirageModel } from 'ember-osf-web/mirage/factories/preprint';
import { MirageRegistration } from 'ember-osf-web/mirage/factories/registration';
import { MirageReviewAction } from 'ember-osf-web/mirage/factories/review-action';
import PreprintModel from 'ember-osf-web/models/preprint';
import { ReviewsState } from 'ember-osf-web/models/provider';
import RegistrationModel, { RegistrationReviewStates } from 'ember-osf-web/models/registration';
import { RegistrationReviewStates } from 'ember-osf-web/models/registration';
import { ReviewActionTrigger } from 'ember-osf-web/models/review-action';
import { RevisionReviewStates } from 'ember-osf-web/models/schema-response';

Expand All @@ -25,7 +24,7 @@ export function createReviewAction(this: HandlerContext, schema: Schema, request
dateModified: new Date(),
...attrs,
});
if (target instanceof PreprintModel) {
if (target.modelName === 'preprint') {
switch (trigger) {
case ReviewActionTrigger.Submit:
target.reviewsState = ReviewsState.PENDING;
Expand All @@ -40,7 +39,7 @@ export function createReviewAction(this: HandlerContext, schema: Schema, request
default:
break;
}
} else if (target instanceof RegistrationModel) {
} else if (target.modelName === 'registration') {
switch (trigger) {
case ReviewActionTrigger.AcceptSubmission:
case ReviewActionTrigger.RejectWithdrawal:
Expand Down

0 comments on commit 550042d

Please sign in to comment.