File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -463,3 +463,30 @@ describe('Miro service', () => {
463
463
} )
464
464
} ) ;
465
465
466
+ describe ( 'whimsical' , ( ) => {
467
+ it ( 'should correctly parse URL got from a browser' , ( ) => {
468
+ const regularBoardUrl = 'https://whimsical.com/test-86ajy7vWEzYATvwFFvbwfA' ;
469
+ const event = composePasteEventMock ( 'pattern' , 'whimsical' , regularBoardUrl ) ;
470
+
471
+ embed . onPaste ( event ) ;
472
+
473
+ expect ( patterns . whimsical . test ( regularBoardUrl ) ) . to . be . true ;
474
+ expect ( embed . data . service ) . to . be . equal ( 'whimsical' ) ;
475
+ expect ( embed . data . embed ) . to . be . equal ( 'https://whimsical.com/embed/86ajy7vWEzYATvwFFvbwfA' ) ;
476
+ expect ( embed . data . source ) . to . be . equal ( regularBoardUrl ) ;
477
+ } ) ;
478
+ } ) ;
479
+
480
+ describe ( 'figma' , ( ) => {
481
+ it ( 'should correctly parse URL got from a browser' , ( ) => {
482
+ const regularBoardUrl = 'https://www.figma.com/file/3BYrViWFPvfhbrpm1aO3ha/Untitled?type=design&node-id=0%3A1&mode=design&t=WutMRT9L8VJNEL5z-1' ;
483
+ const event = composePasteEventMock ( 'pattern' , 'figma' , regularBoardUrl ) ;
484
+
485
+ embed . onPaste ( event ) ;
486
+
487
+ expect ( patterns . figma . test ( regularBoardUrl ) ) . to . be . true ;
488
+ expect ( embed . data . service ) . to . be . equal ( 'figma' ) ;
489
+ expect ( embed . data . embed ) . to . be . equal ( 'https://www.figma.com/embed?embed_host=share&url=https://www.figma.com/file/3BYrViWFPvfhbrpm1aO3ha/Untitled?type=design&node-id=0%3A1&mode=design&t=WutMRT9L8VJNEL5z-1' ) ;
490
+ expect ( embed . data . source ) . to . be . equal ( regularBoardUrl ) ;
491
+ } ) ;
492
+ } ) ;
You can’t perform that action at this time.
0 commit comments