@@ -74,8 +74,8 @@ describe('The Clip Object', () => {
7474
7575 // 30 fps is the default
7676 const composition = new Composition ( ) ;
77- const track = composition . appendTrack ( Track ) ;
78- await track . appendClip ( clip ) ;
77+ const track = composition . createTrack ( 'base' ) ;
78+ await track . add ( clip ) ;
7979
8080 expect ( clip . track ?. id ) . toBe ( track . id ) ;
8181 expect ( clip . state ) . toBe ( 'ATTACHED' ) ;
@@ -92,11 +92,11 @@ describe('The Clip Object', () => {
9292 const secondClip = new Clip ( { stop : < frame > 900 , start : < frame > 570 } ) ;
9393
9494 const composition = new Composition ( ) ;
95- const track = composition . appendTrack ( Track ) ;
95+ const track = composition . createTrack ( 'base' ) ;
9696 expect ( track . clips . length ) . toBe ( 0 ) ;
97- await track . appendClip ( clip ) ;
97+ await track . add ( clip ) ;
9898 expect ( track . clips . length ) . toBe ( 1 ) ;
99- await track . appendClip ( secondClip ) ;
99+ await track . add ( secondClip ) ;
100100 expect ( track . clips . length ) . toBe ( 2 ) ;
101101 expect ( track . clips . findIndex ( ( n ) => n . id == clip . id ) ) . toBe ( 0 ) ;
102102 expect ( clip . state ) . toBe ( 'ATTACHED' ) ;
@@ -110,9 +110,9 @@ describe('The Clip Object', () => {
110110
111111 it ( 'should be not remove error state on detach' , async ( ) => {
112112 const composition = new Composition ( ) ;
113- const track = composition . appendTrack ( Track ) ;
113+ const track = composition . createTrack ( 'base' ) ;
114114
115- await track . appendClip ( clip ) ;
115+ await track . add ( clip ) ;
116116 expect ( track . clips . length ) . toBe ( 1 ) ;
117117 clip . state = 'ERROR' ;
118118 expect ( clip . state ) . toBe ( 'ERROR' ) ;
@@ -126,9 +126,9 @@ describe('The Clip Object', () => {
126126 clip . set ( { stop : < frame > 120 , start : < frame > 100 , name : 'foo' } ) ;
127127
128128 const composition = new Composition ( ) ;
129- const track = composition . appendTrack ( Track ) ;
130- await track . appendClip ( clip ) ;
131- await track . appendClip ( new Clip ( { stop : < frame > 80 , start : < frame > 60 } ) ) ;
129+ const track = composition . createTrack ( 'base' ) ;
130+ await track . add ( clip ) ;
131+ await track . add ( new Clip ( { stop : < frame > 80 , start : < frame > 60 } ) ) ;
132132
133133 expect ( track . clips . length ) . toBe ( 2 ) ;
134134 expect ( track . clips [ 1 ] . name ) . toBe ( 'foo' ) ;
@@ -180,16 +180,16 @@ describe('Split tests - the Clip object', () => {
180180 } ) ;
181181 const track = new Track ( ) ;
182182
183- await track . appendClip ( clip ) ;
183+ await track . add ( clip ) ;
184184
185185 // add a second one after
186- await track . appendClip ( new Clip ( {
186+ await track . add ( new Clip ( {
187187 start : new Timestamp ( 5001 ) ,
188188 stop : new Timestamp ( 6000 )
189189 } ) ) ;
190190
191191 // add a third one befor
192- await track . appendClip ( new Clip ( {
192+ await track . add ( new Clip ( {
193193 start : new Timestamp ( 100 ) ,
194194 stop : new Timestamp ( 999 )
195195 } ) ) ;
@@ -220,8 +220,8 @@ describe('Split tests - the Clip object', () => {
220220 stop : new Timestamp ( 5000 ) ,
221221 } ) ;
222222 const comp = new Composition ( ) ;
223- const track = comp . appendTrack ( Track ) ;
224- await track . appendClip ( clip ) ;
223+ const track = comp . createTrack ( 'base' ) ;
224+ await track . add ( clip ) ;
225225
226226 comp . frame = new Timestamp ( 2700 ) . frames ;
227227
@@ -247,7 +247,7 @@ describe('Split tests - the Clip object', () => {
247247 stop : new Timestamp ( 5000 ) ,
248248 } ) ;
249249
250- await new Track ( ) . appendClip ( clip ) ;
250+ await new Track ( ) . add ( clip ) ;
251251
252252 await expect ( ( ) => clip . split ( new Timestamp ( 1000 ) ) ) . rejects . toThrowError ( ) ;
253253 await expect ( ( ) => clip . split ( new Timestamp ( 5000 ) ) ) . rejects . toThrowError ( ) ;
0 commit comments