@@ -41,7 +41,7 @@ describe('Date Time Input component', () => {
4141 describe ( '' , async ( ) => {
4242 beforeEach ( async ( ) => {
4343 el = await fixture < IgcDateTimeInputComponent > (
44- html `< igc-date-time-input always-leading-zero > </ igc-date-time-input > `
44+ html `< igc-date-time-input > </ igc-date-time-input > `
4545 ) ;
4646 input = el . renderRoot . querySelector ( 'input' ) ! ;
4747 parser . prompt = defaultPrompt ;
@@ -60,18 +60,20 @@ describe('Date Time Input component', () => {
6060 await elementUpdated ( el ) ;
6161 expect ( el . placeholder ) . to . equal ( 'dd.MM.yyyy' ) ;
6262 expect ( el . inputFormat ) . to . equal ( 'dd.MM.yyyy' ) ;
63+ expect ( el . displayFormat ) . to . equal ( 'd.M.yyyy' ) ;
6364 } ) ;
6465
6566 it ( 'should update inputFormat with value according to locale' , async ( ) => {
6667 el . value = new Date ( 2020 , 2 , 3 ) ;
6768 await elementUpdated ( el ) ;
68- expect ( input . value ) . to . equal ( '03/03 /2020' ) ;
69+ expect ( input . value ) . to . equal ( '3/3 /2020' ) ;
6970
7071 el . locale = 'no' ;
7172 await elementUpdated ( el ) ;
7273 expect ( el . placeholder ) . to . equal ( 'dd.MM.yyyy' ) ;
7374 expect ( el . inputFormat ) . to . equal ( 'dd.MM.yyyy' ) ;
74- expect ( input . value ) . to . equal ( '03.03.2020' ) ;
75+ expect ( el . displayFormat ) . to . equal ( 'd.M.yyyy' ) ;
76+ expect ( input . value ) . to . equal ( '3.3.2020' ) ;
7577 } ) ;
7678
7779 it ( 'should use inputFormat if no displayFormat is defined - issue 1114' , async ( ) => {
@@ -108,13 +110,12 @@ describe('Date Time Input component', () => {
108110 el . value = new Date ( 2020 , 2 , 3 ) ;
109111 await elementUpdated ( el ) ;
110112
111- expect ( input . value ) . to . equal ( '03/03 /2020' ) ;
113+ expect ( input . value ) . to . equal ( '3/3 /2020' ) ;
112114
113115 el . displayFormat = 'dd.MM/yyyy' ;
114116 await elementUpdated ( el ) ;
115117 expect ( input . value ) . to . equal ( '03.03/2020' ) ;
116118
117- el . alwaysLeadingZero = false ;
118119 el . displayFormat = 'd.M' ;
119120 await elementUpdated ( el ) ;
120121 expect ( input . value ) . to . equal ( '3.3' ) ;
@@ -201,7 +202,7 @@ describe('Date Time Input component', () => {
201202 await elementUpdated ( el ) ;
202203
203204 expect ( eventSpy ) . calledWith ( 'igcChange' ) ;
204- expect ( input . value ) . to . deep . equal ( '01/01 /2000' ) ;
205+ expect ( input . value ) . to . deep . equal ( '1/1 /2000' ) ;
205206 } ) ;
206207
207208 it ( 'should correctly switch between different pre-defined date formats' , async ( ) => {
@@ -275,7 +276,7 @@ describe('Date Time Input component', () => {
275276 it ( 'should clear input date on clear' , async ( ) => {
276277 el . value = new Date ( 2020 , 2 , 3 ) ;
277278 await elementUpdated ( el ) ;
278- expect ( input . value ) . to . equal ( '03/03 /2020' ) ;
279+ expect ( input . value ) . to . equal ( '3/3 /2020' ) ;
279280
280281 el . clear ( ) ;
281282 await elementUpdated ( el ) ;
@@ -831,7 +832,7 @@ describe('Date Time Input component', () => {
831832 it ( 'Drop behavior' , async ( ) => {
832833 el . value = new Date ( 2020 , 2 , 3 ) ;
833834 await elementUpdated ( el ) ;
834- expect ( input . value ) . to . equal ( '03/03 /2020' ) ;
835+ expect ( input . value ) . to . equal ( '3/3 /2020' ) ;
835836
836837 input . value = '1010' ;
837838 input . setSelectionRange ( 0 , 4 ) ;
0 commit comments