Skip to content

Commit

Permalink
Update setting.test.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
aelassas committed Nov 12, 2024
1 parent 94159f7 commit 5c02b22
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions api/tests/setting.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('Initialize settings', () => {
it('should initialize settings', async () => {
// init
const settings = await Setting.findOne().lean()
await Setting.deleteMany()
await Setting.deleteMany({})

// test success
let res = await settingController.init()
Expand All @@ -49,7 +49,7 @@ describe('Initialize settings', () => {

// restore
if (settings) {
await Setting.deleteMany()
await Setting.deleteMany({})
await new Setting({
language: settings.language,
currency: settings.currency,
Expand Down Expand Up @@ -80,7 +80,7 @@ describe('GET /api/language', () => {

// test default value
const settings = await Setting.findOne().lean()
await Setting.deleteMany()
await Setting.deleteMany({})
res = await request(app)
.get('/api/language')
expect(res.statusCode).toBe(200)
Expand Down Expand Up @@ -118,7 +118,7 @@ describe('GET /api/currency', () => {

// test default value
const settings = await Setting.findOne().lean()
await Setting.deleteMany()
await Setting.deleteMany({})
res = await request(app)
.get('/api/currency')
expect(res.statusCode).toBe(200)
Expand Down Expand Up @@ -156,7 +156,7 @@ describe('GET /api/stripe-currency', () => {

// test default value
const settings = await Setting.findOne().lean()
await Setting.deleteMany()
await Setting.deleteMany({})
res = await request(app)
.get('/api/stripe-currency')
expect(res.statusCode).toBe(200)
Expand Down Expand Up @@ -289,7 +289,7 @@ describe('PUT /api/update-bank-settings', () => {
expect(_settings!.iban).toBe('GB007780000125300000000023')

// test not found
await Setting.deleteMany()
await Setting.deleteMany({})
res = await request(app)
.put('/api/update-bank-settings')
.set(env.X_ACCESS_TOKEN, token)
Expand Down

0 comments on commit 5c02b22

Please sign in to comment.