import { createMock } from 'ts-auto-mock' ; import ImportDefaultInterface from '../utils/interfaces/importDefaultInterface' ; import { ImportInterface , ImportInterfaceWithNestedInterface , } from '../utils/interfaces/importInterface' ; import { ImportNamespace } from '../utils/interfaces/importNameSpace' ; import { ImportType , Type } from '../utils/types/type' ; describe ( 'with import' , ( ) => { describe ( 'for interfaces' , ( ) => { it ( 'should set the default property for import' , ( ) => { const properties = createMock < ImportInterface > ( ) ; expect ( properties . a . b ) . toBe ( '' ) ; } ) ; it ( 'should set the default property for import with sub imports' , ( ) => { const properties = createMock < ImportInterfaceWithNestedInterface > ( ) ; expect ( properties . a . test ) . toBe ( false ) ; } ) ; it ( 'should set the default property for default' , ( ) => { const properties = createMock < ImportDefaultInterface > ( ) ; expect ( properties . a ) . toBe ( '' ) ; } ) ; it ( 'should set the default property for namespace' , ( ) => { const properties = createMock < ImportNamespace . Interface > ( ) ; expect ( properties . a ) . toBe ( '' ) ; } ) ; it ( 'should set the default property for namespace' , ( ) => { const properties = createMock < ImportNamespace . Interface2 > ( ) ; expect ( properties . b ) . toBe ( 0 ) ; } ) ; it ( 'should be possible to change the value' , ( ) => { const properties = createMock < ImportNamespace . Interface2 > ( ) ; expect ( properties . b ) . toBe ( 0 ) ; properties . b = 2 ; expect ( properties . b ) . toBe ( 2 ) ; } ) ; } ) ; describe ( 'for types' , ( ) => { it ( 'should set the correct property' , ( ) => { const properties = createMock < Type > ( ) ; expect ( properties . a ) . toBe ( '' ) ; } ) ; it ( 'should set the correct property' , ( ) => { const properties = createMock < { a : ImportType ; } > ( ) ; expect ( properties . a ) . toBeUndefined ( ) ; } ) ; } ) ; } ) ;