import { test } from '@japa/runner'
import { File, ThingKind } from '../../../../src/index.js'

test.group('File.constructor()', () => {
  test('creates a default File', ({ assert }) => {
    const result = new File()
    assert.equal(result.kind, '')
    assert.isString(result.key, 'has the key')
    assert.isNotEmpty(result.key, 'key is not empty')
    assert.deepEqual(result.info.toJSON(), { kind: ThingKind, name: 'Unnamed file' })
    assert.deepEqual(result.parents, [])
    assert.deepEqual(result.permissionIds, [])
    assert.isFalse(result.deleted, 'deleted')
    assert.isUndefined(result.deletedInfo)
    assert.isUndefined(result.labels)
    assert.isUndefined(result.iconColor)
    assert.deepEqual(result.lastModified, { user: '', time: 0, byMe: false })
  })
})
