Skip to content

Commit

Permalink
Moved v1 campaign PUT tests to integration directory
Browse files Browse the repository at this point in the history
Fixed broken import caused by moving that file

Co-authored-by: shangguanwang <[email protected]>
  • Loading branch information
DietBepis1 and shangguanwang committed Dec 31, 2023
1 parent 64502e4 commit c283f83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const request = require('supertest')
const app = require('../../app')
const Campaign = require('../../db/models/campaign')
const app = require('../../../../../../../app')
const Campaign = require('../../../../../../../db/models/campaign')

jest.mock('../../db/models/campaign')
jest.mock('../../../../../../../db/models/campaign')

describe('PUT /api/v1/campaigns/:id', () => {
it('should return 200 if successfully updated the campaign', async () => {
Expand Down
15 changes: 0 additions & 15 deletions server/db/models/campaign.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,6 @@ class Campaign extends BaseModel {
}
}
}

// This object defines the relations to other models.
static get relationMappings() {
const LetterVersion = require('./letter-version')
return {
LetterVersions: {
relation: BaseModel.HasManyRelation,
modelClass: LetterVersion,
join: {
from: 'campaigns.id',
to: 'letter_versions.campaign_id'
}
}
}
}
}

module.exports = Campaign

0 comments on commit c283f83

Please sign in to comment.