@@ -2,45 +2,45 @@ import { validateCommitOrder } from "../src/utils/validateCommits";
22
33describe ( "commitOrder" , ( ) => {
44 it ( "should return true if order is valid" , ( ) => {
5- const positions = [ "INIT" , "L1 " , "L1S1 " , "L1S2 " , "L2 " , "L2S1 " ] ;
5+ const positions = [ "INIT" , "1 " , "1.1 " , "1.2 " , "2 " , "2.1 " ] ;
66 const result = validateCommitOrder ( positions ) ;
77 expect ( result ) . toBe ( true ) ;
88 } ) ;
99 it ( "should return true if valid with duplicates" , ( ) => {
1010 const positions = [
1111 "INIT" ,
1212 "INIT" ,
13- "L1 " ,
14- "L1 " ,
15- "L1S1 " ,
16- "L1S1 " ,
17- "L1S2 " ,
18- "L1S2 " ,
19- "L2 " ,
20- "L2 " ,
21- "L2S1 " ,
22- "L2S1 " ,
13+ "1 " ,
14+ "1 " ,
15+ "1.1 " ,
16+ "1.1 " ,
17+ "1.2 " ,
18+ "1.2 " ,
19+ "2 " ,
20+ "2 " ,
21+ "2.1 " ,
22+ "2.1 " ,
2323 ] ;
2424 const result = validateCommitOrder ( positions ) ;
2525 expect ( result ) . toBe ( true ) ;
2626 } ) ;
2727 it ( "should return false if INIT is out of order" , ( ) => {
28- const positions = [ "INIT" , "L1 " , "L1S1 " , "L1S2 " , "INIT" , "L2 " , "L2S1 " ] ;
28+ const positions = [ "INIT" , "1 " , "1.1 " , "1.2 " , "INIT" , "2 " , "2.1 " ] ;
2929 const result = validateCommitOrder ( positions ) ;
3030 expect ( result ) . toBe ( false ) ;
3131 } ) ;
3232 it ( "should return false if level after step is out of order" , ( ) => {
33- const positions = [ "INIT" , "L1 " , "L1S1 " , "L1S2 " , "L2S1 " , "L2 " ] ;
33+ const positions = [ "INIT" , "1 " , "1.1 " , "1.2 " , "2.1 " , "2 " ] ;
3434 const result = validateCommitOrder ( positions ) ;
3535 expect ( result ) . toBe ( false ) ;
3636 } ) ;
3737 it ( "should return false if level is out of order" , ( ) => {
38- const positions = [ "INIT" , "L1 " , "L3" , "L2 " ] ;
38+ const positions = [ "INIT" , "1 " , "L3" , "2 " ] ;
3939 const result = validateCommitOrder ( positions ) ;
4040 expect ( result ) . toBe ( false ) ;
4141 } ) ;
4242 it ( "should return false if step is out of order" , ( ) => {
43- const positions = [ "INIT" , "L1 " , "L1S1 " , "L1S3 " , "L1S2 " ] ;
43+ const positions = [ "INIT" , "1 " , "1.1 " , "1.3 " , "1.2 " ] ;
4444 const result = validateCommitOrder ( positions ) ;
4545 expect ( result ) . toBe ( false ) ;
4646 } ) ;
0 commit comments