import virtualBackgroundReducer, {
  clearCurrentVirtualBackground,
  setCurrentVirtualBackground,
} from './virtualBackgroundSlice'
import { VirtualBackgroundType } from '@zocks-communications/client-sdk-js'

test('sets the current virtual background', () => {
  const state = {
    currentVirtualBackground: null,
  }

  expect(virtualBackgroundReducer(state, setCurrentVirtualBackground(VirtualBackgroundType.BLUR))).toStrictEqual({
    currentVirtualBackground: VirtualBackgroundType.BLUR,
  })
})

test('clears the current virtual background', () => {
  const state = {
    currentVirtualBackground: VirtualBackgroundType.BLUR,
  }

  expect(virtualBackgroundReducer(state, clearCurrentVirtualBackground())).toStrictEqual({
    currentVirtualBackground: null,
  })
})
