import { shouldGenerateLog, tables2025DirectoryPath, tablesDirectoryPath, testsDirectoryPath } from './shared/constants'

const ficum = require('bindings')('ficum')

describe('ficum', () => {
  describe('2025 version', () => {
    const result2025 = ficum.main(
      `${testsDirectoryPath}/ficum.test.input.txt`, // Input file
      `${tables2025DirectoryPath}/ficum.fg2025$.txt`, // Output file
      `${tables2025DirectoryPath}/`, // Directory tables
      shouldGenerateLog,
      1, // Gestion portee globale
      1 // Include FINESS geographique
    )

    it('2025 ficum generation should work', () => {
      expect(result2025.returnCode).toBe(0)
      expect(result2025.success).toBe(true)
    })
  })

  describe('2024 version', () => {
    const result2024 = ficum.main(
      `${testsDirectoryPath}/ficum.test.input.txt`, // Input file
      `${tablesDirectoryPath}/V2024/ficum.fg2024$.txt`, // Output file
      `${tablesDirectoryPath}/V2024/`, // Directory tables
      shouldGenerateLog,
      1, // Gestion portee globale
      1 // Include FINESS geographique
    )

    it('2024 ficum generation should work', () => {
      expect(result2024.returnCode).toBe(0)
      expect(result2024.success).toBe(true)
    })
  })
})
