All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ducks.widgets.__tests__.sagas.test.js Maven / Gradle / Ivy

The newest version!
import { put } from 'redux-saga/effects'

import { setModel } from '../../models/store'
import { ModelPrefix } from '../../../core/datasource/const'
import {
    runResolve,
} from '../sagas'

describe('Проверка саги widgets', () => {
    it('Должен произойти runResolve', () => {
        const action = {
            payload: {
                modelId: 'testId',
                model: {
                    some: 'value',
                },
            },
        }
        const gen = runResolve(action)

        expect(gen.next().value.payload).toEqual(
            put(
                setModel(
                    ModelPrefix.active,
                    action.payload.modelId,
                    action.payload.model,
                ),
            ).payload,
        )
    })
})




© 2015 - 2024 Weber Informatics LLC | Privacy Policy