Skip to content

Commit

Permalink
chore: remove tests from removed method
Browse files Browse the repository at this point in the history
  • Loading branch information
cazala committed Dec 16, 2023
1 parent aec40e1 commit fa6e879
Showing 1 changed file with 1 addition and 25 deletions.
26 changes: 1 addition & 25 deletions src/modules/project/sagas.spec.ts
Original file line number Diff line number Diff line change
@@ -1,39 +1,15 @@
import { expectSaga } from 'redux-saga-test-plan'
import { call } from 'redux-saga/effects'
import { Wallet } from 'decentraland-dapps/dist/modules/wallet/types'
import { AuthIdentity } from '@dcl/crypto'
import { BuilderAPI } from 'lib/api/builder'
import { mockTemplate, mockTemplates } from 'specs/project'
import { loginSuccess } from 'modules/identity/actions'
import { loadProjectsRequest, loadTemplatesFailure, loadTemplatesRequest, loadTemplatesSuccess } from './actions'
import { loadProjectsRequest, loadTemplatesRequest } from './actions'
import { projectSaga } from './sagas'

const builderAPI = {
fetchTemplates: jest.fn()
} as unknown as BuilderAPI

describe('when handling the loadTemplatesRequest action', () => {
describe('and the request is successful', () => {
it('should put a loadTemplatesSuccess action with the project templates', () => {
return expectSaga(projectSaga, builderAPI)
.provide([[call([builderAPI, 'fetchTemplates']), Promise.resolve([mockTemplate])]])
.put(loadTemplatesSuccess(mockTemplates))
.dispatch(loadTemplatesRequest())
.run({ silenceTimeout: true })
})
})

describe('and the request fails', () => {
it('should put a loadTemplatesFailure action with the error', () => {
return expectSaga(projectSaga, builderAPI)
.provide([[call([builderAPI, 'fetchTemplates']), Promise.reject(new Error('error'))]])
.put(loadTemplatesFailure('error'))
.dispatch(loadTemplatesRequest())
.run({ silenceTimeout: true })
})
})
})

describe('when handling the loginSuccess action', () => {
let wallet: Wallet
let identity: AuthIdentity
Expand Down

0 comments on commit fa6e879

Please sign in to comment.