File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66import { describe , expect , it } from 'vitest'
77import {
88 getCurrentUserSignRequestIds ,
9+ getFileUrl ,
910 getVisibleElementsFromDocument ,
1011 hasVisibleElementsForCurrentUser ,
1112} from '../../services/visibleElementsService'
1213
1314describe ( 'visibleElementsService' , ( ) => {
15+ describe ( 'getFileUrl' , ( ) => {
16+ it ( 'supports nested file objects with url payloads' , ( ) => {
17+ const file = {
18+ file : {
19+ url : '/apps/libresign/p/pdf/uuid-123' ,
20+ } ,
21+ }
22+
23+ expect ( getFileUrl ( file ) ) . toBe ( '/apps/libresign/p/pdf/uuid-123' )
24+ } )
25+
26+ it ( 'finds the first renderable child file recursively' , ( ) => {
27+ const file = {
28+ files : [
29+ { id : 10 , file : null } ,
30+ { id : 20 , file : { url : '/apps/libresign/p/pdf/uuid-456' } } ,
31+ ] ,
32+ }
33+
34+ expect ( getFileUrl ( file ) ) . toBe ( '/apps/libresign/p/pdf/uuid-456' )
35+ } )
36+ } )
37+
1438 describe ( 'getVisibleElementsFromDocument' , ( ) => {
1539 it ( 'includes visible elements from child files (envelope)' , ( ) => {
1640 const document = {
You can’t perform that action at this time.
0 commit comments