@@ -74,6 +74,7 @@ describe('OrchestratorCreateTests', () => {
7474 assert . ok ( snapshotContent . indexOf ( 'HomeAutomation' ) > 0 ) ;
7575 assert . ok ( snapshotContent . indexOf ( 'Weather' ) > 0 ) ;
7676
77+ // add another lu file to input and make sure new intent is added (snapshot updated incrementally)
7778 fs . ensureDirSync ( inputPath2 ) ;
7879 fs . copySync ( path . resolve ( inputPath ) , inputPath2 ) ;
7980 fs . copySync ( path . resolve ( './test/fixtures/Gaming.lu' ) , path . join ( inputPath2 , 'Gaming.lu' ) ) ;
@@ -91,6 +92,22 @@ describe('OrchestratorCreateTests', () => {
9192 assert . ok ( snapshotContent2 . indexOf ( 'HomeAutomation' ) > 0 ) ;
9293 assert . ok ( snapshotContent2 . indexOf ( 'Weather' ) > 0 ) ;
9394 assert . ok ( snapshotContent2 . indexOf ( 'Gaming' ) > 0 ) ;
95+
96+ // start clean and make sure file size is the same as previous run (snapshot created via addBatch)
97+ Utility . deleteFile ( snapshotPath ) ;
98+ await OrchestratorCreate . runAsync (
99+ baseModelPath ,
100+ '' ,
101+ inputPath2 ,
102+ inputPath ,
103+ true ) ;
104+
105+ assert . ok ( Utility . exists ( snapshotPath ) ) ;
106+ const snapshotContent3 : string = OrchestratorHelper . readFile ( snapshotPath ) ;
107+ assert . ok ( snapshotContent3 . length === snapshotContent2 . length ) ;
108+ assert . ok ( snapshotContent2 . indexOf ( 'HomeAutomation' ) > 0 ) ;
109+ assert . ok ( snapshotContent2 . indexOf ( 'Weather' ) > 0 ) ;
110+ assert . ok ( snapshotContent2 . indexOf ( 'Gaming' ) > 0 ) ;
94111 } ) ;
95112
96113 it ( 'Create Snapshot - LU file with reference to other LU file' , async function ( ) : Promise < void > {
0 commit comments