Skip to content

Commit

Permalink
update iteration unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotmessi committed Jun 12, 2023
1 parent d52ebd8 commit 903c20c
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions ymir/web/src/models/__test__/iteration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ function equalObject(obj1, obj2) {

describe('models: iteration', () => {
const createGenerator = generatorCreator(iteration)
normalReducer(iteration, 'UPDATE_ITERATIONS', { 13424: product(34) }, { 13424: product(34) }, 'iterations', {})
normalReducer(iteration, 'UPDATE_ITERATION', { 100434: product(100434) }, { 100434: product(100434) }, 'iteration', {})
normalReducer(iteration, 'UpdateIterations', { 13424: product(34) }, { 13424: product(34) }, 'iterations', {})
normalReducer(iteration, 'UpdateIteration', { 100434: product(100434) }, { 100434: product(100434) }, 'iteration', {})

errorCode(iteration, 'getIterations')
errorCode(iteration, 'createIteration')
errorCode(iteration, 'updateIteration')

it('effects: getIterations -> success', () => {
const iterations = products(5)
Expand Down Expand Up @@ -98,24 +97,6 @@ describe('models: iteration', () => {
generator.next([])
const end = generator.next()

expect(end.value).toEqual(expected)
expect(end.done).toBe(true)
})
it('effects: updateIteration', () => {
const origin = { id: 10011, name: 'new_iteration_name' }

const expected = transferIteration(origin)
const generator = createGenerator('updateIteration', origin)

generator.next()
generator.next({
code: 0,
result: expected,
})
generator.next()
generator.next([])
const end = generator.next()

expect(end.value).toEqual(expected)
expect(end.done).toBe(true)
})
Expand Down

0 comments on commit 903c20c

Please sign in to comment.