import { type Server } from '@hapi/hapi'

import { type PluginOptions } from '../../types.js'
import { type CacheService } from '../../../../services/index.js'

export const server: Server = {
  plugins: {
    'forms-engine-plugin': {
      baseLayoutPath: '',
      cacheService: {} as CacheService
    }
  }
} as Server // only mocking out properties we care about;

export const serverWithSaveAndExit: Server = {
  plugins: {
    ...server.plugins,
    'forms-engine-plugin': {
      ...server.plugins['forms-engine-plugin'],
      saveAndExit: jest.fn().mockReturnValue({}) as Pick<
        PluginOptions,
        'saveAndExit'
      >
    }
  }
} as Server // only mocking out properties we care about
