File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
e2e/testcafe-devextreme/tests/cardView Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ import CardView from 'devextreme-testcafe-models/cardView' ;
2+ import url from '../../helpers/getPageUrl' ;
3+ import { createWidget } from '../../helpers/createWidget' ;
4+
5+ fixture . disablePageReloads `CardView - Security`
6+ . page ( url ( __dirname , '../container.html' ) ) ;
7+
8+ const UNSAFE_TEXT = '<script>console.log("XSS!")</script>' ;
9+
10+ test ( 'Script inside cell text should not be executed after opening header filter' , async ( t ) => {
11+ const cardView = new CardView ( '#container' ) ;
12+
13+ await t . click (
14+ cardView . getHeaderPanel ( ) . getHeaderItem ( ) . getFilterIcon ( ) ,
15+ ) ;
16+
17+ await t . expect (
18+ cardView . getHeaderFilterList ( ) . getItem ( 0 ) . text ,
19+ ) . eql ( UNSAFE_TEXT ) ;
20+ } ) . before ( async ( ) => createWidget ( 'dxCardView' , {
21+ columns : [ 'caption' ] ,
22+ headerFilter : {
23+ visible : true ,
24+ } ,
25+ dataSource : [
26+ { id : 1 , caption : UNSAFE_TEXT } ,
27+ ] ,
28+ } ) ) ;
You can’t perform that action at this time.
0 commit comments