mirror of
https://github.com/cgiesche/streamdeck-homeassistant.git
synced 2026-01-14 08:28:01 -05:00
20 lines
673 B
TypeScript
20 lines
673 B
TypeScript
import { expect, it } from 'vitest'
|
|
|
|
import { Entity } from '@/models/entity'
|
|
|
|
it('test constructing entity', () => {
|
|
const entity = new Entity('light.living_room', 'Living Room Light')
|
|
expect(entity.domain).toBe('light')
|
|
expect(entity.name).toBe('living_room')
|
|
expect(entity.title).toBe('Living Room Light')
|
|
expect(entity.entityId).toBe('light.living_room')
|
|
})
|
|
|
|
it('test constructing entity without friendly name', () => {
|
|
const entity = new Entity('light.living_room', null)
|
|
expect(entity.domain).toBe('light')
|
|
expect(entity.name).toBe('living_room')
|
|
expect(entity.title).toBe('light.living_room')
|
|
expect(entity.entityId).toBe('light.living_room')
|
|
})
|