import {expect, test} from 'vitest'
import {Services} from './helpers'

test('not empty services', () => {
  const newServices = new Services()
  const servicesUpdated = newServices.getServices()
  expect(servicesUpdated).toBeTypeOf('object')
  expect(servicesUpdated.length).toBeGreaterThan(0)
})

test('added check work services', () => {
  const newServices = new Services()
  const servicesData = newServices.getServices()
  expect(servicesData[0]).toHaveProperty('is_online')
})

test('added service detales', () => {
  const newServices = new Services()
  const servicesData = newServices.getServices()
  const servicesUpdated = newServices.serviceDetales(servicesData)
  expect(servicesUpdated.length).toBeGreaterThan(5)
  expect(servicesUpdated[0]).toHaveProperty('title')
  expect(servicesUpdated[1]).toHaveProperty('serviceIp')
  expect(servicesUpdated[2]).toHaveProperty('serviceCode')
  expect(servicesUpdated[3]).toHaveProperty('dateStart')
  expect(servicesUpdated[4]).toHaveProperty('serviceLink')
})