1- import { test , expect } from "@playwright/experimental-ct-react" ;
1+ import { test } from "@playwright/experimental-ct-react" ;
22import { LocalDataSourceProvider } from "@vuu-ui/vuu-data-test" ;
3+ import { expect } from "../../../../../playwright/customAssertions" ;
4+
35import {
46 ContainerManagedNumericColumnFilter ,
57 ContainerManagedTextColumnFilter ,
@@ -18,62 +20,6 @@ import {
1820import { ColumnFilterProps } from "../../column-filter/ColumnFilter" ;
1921import { FilterAppliedHandler } from "../../filter-container/useFilterContainer" ;
2022
21- declare global {
22- namespace PlaywrightTest {
23- interface Matchers < R > {
24- toHaveSelection ( start : number , end : number ) : R ;
25- }
26- }
27- }
28- // TODO figure out where we put this to make it shareable
29- expect . extend ( {
30- async toHaveSelection ( locator , start , end ) {
31- let pass : boolean ;
32- let selection : [ number , number ] | undefined = undefined ;
33- let errorName : string | undefined ;
34-
35- try {
36- await expect
37- . poll (
38- async ( ) => {
39- return await locator . evaluate ( ( el : object ) => {
40- const { selectionStart, selectionEnd } = el as HTMLInputElement ;
41- return [ selectionStart , selectionEnd ] ;
42- } ) ;
43- } ,
44- { timeout : 1000 } ,
45- )
46- . toEqual ( [ start , end ] ) ;
47- pass = true ;
48- } catch ( error ) {
49- errorName = ( error as Error ) . message . replace (
50- "toEqual" ,
51- "toHaveSelection" ,
52- ) ;
53- pass = false ;
54- }
55- const message = ( ) =>
56- pass
57- ? ( errorName ? `\x1b[31m${ errorName } for \x1b[0m` : "" ) +
58- this . utils . matcherHint ( "toHaveSelection" , undefined , undefined , {
59- isNot : this . isNot ,
60- } ) +
61- "\n\n" +
62- `Locator: ${ locator } \n` +
63- `Expected: ${ this . isNot ? "not" : "" } ${ this . utils . printExpected ( [ start , end ] ) } \n` +
64- ( selection ? `Received: ${ this . utils . printReceived ( selection ) } ` : "" )
65- : "Failed!\n" + errorName ! ;
66-
67- return {
68- message,
69- pass,
70- name : "toHaveSelection" ,
71- expected : [ start , end ] ,
72- actual : selection ,
73- } ;
74- } ,
75- } ) ;
76-
7723const BBG = { name : "bbg" , serverDataType : "string" } ;
7824const PRICE = { name : "price" , serverDataType : "double" } ;
7925const VUU_CREATED = {
0 commit comments