File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -28,4 +28,11 @@ describe("iframe util", () => {
28
28
expect ( iframe . style . height ) . toEqual ( "100%" ) ;
29
29
} ) ;
30
30
} ) ;
31
+
32
+ it ( "returns an iframe with the allow attribute set to clipboard-read and clipboard-write" , ( ) => {
33
+ return import ( "./iframe" ) . then ( ( { createIframe } ) => {
34
+ const iframe = createIframe ( mockSrc ) as HTMLIFrameElement ;
35
+ expect ( iframe . allow ) . toEqual ( "clipboard-write" ) ;
36
+ } ) ;
37
+ } ) ;
31
38
} ) ;
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ const createIframe = (src: string): HTMLElement => {
5
5
iframe . style . setProperty ( "width" , "100%" ) ;
6
6
iframe . style . setProperty ( "height" , "100%" ) ;
7
7
iframe . style . setProperty ( "border" , "none" ) ;
8
+ iframe . allow = "clipboard-write" ;
8
9
iframe . src = src ;
9
10
10
11
return wrapWithLoader ( iframe ) ;
You can’t perform that action at this time.
0 commit comments