Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

759 B
Raw Blame
import { createFeaturesStore } from '../store'

it('restores persisted feature configuration and replaces it without leaking settings across apps', () => {
  const persisted = {
    opening: { enabled: true, opening_statement: 'Hello!' },
    citation: { enabled: true },
  }
  const first = createFeaturesStore({ features: persisted })
  const second = createFeaturesStore()
  expect(first.getState().features).toEqual(persisted)
  const replacement = { opening: { enabled: false }, moreLikeThis: { enabled: true } }
  first.getState().setFeatures(replacement)
  expect(first.getState().features).toEqual(replacement)
  expect(second.getState().features.moreLikeThis?.enabled).toBe(false)
  expect(second.getState().features.opening?.enabled).toBe(false)
})