Skip to content

A games launcher for GOG, Amazon and Epic Games for Linux, Windows and macOS.

758 B
Raw Blame
import { canInstallZoomSelection } from '../zoomFiles'

const files = {
  game: [{ id: 'game-a' }],
  extras: [{ id: 'extra-a' }]
} as unknown as Parameters<typeof canInstallZoomSelection>[0]

describe('canInstallZoomSelection', () => {
  it('requires a loaded fetch without an error', () => {
    expect(canInstallZoomSelection(files, ['game-a'], null, true)).toBe(true)
    expect(canInstallZoomSelection(files, ['game-a'], null, false)).toBe(false)
    expect(canInstallZoomSelection(files, ['game-a'], 'failed', true)).toBe(
      false
    )
  })

  it('requires a selected game file', () => {
    expect(canInstallZoomSelection(files, ['extra-a'], null, true)).toBe(false)
    expect(canInstallZoomSelection(files, [], null, true)).toBe(false)
  })
})