File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -1919,6 +1919,52 @@ describe("veTable cell edit", () => {
19191919 expect ( mockFn ) . not . toHaveBeenCalled ( ) ;
19201920 } ) ;
19211921
1922+ /*
1923+ 不可编辑文本框双击允许移动单元格
1924+ */
1925+ it ( "nnormal cell dblclick move active cell" , async ( ) => {
1926+ const wrapper = mount ( veTable , {
1927+ propsData : {
1928+ columns : COLUMNS ,
1929+ tableData : cloneDeep ( TABLE_DATA ) ,
1930+ editOption : { } ,
1931+ rowKeyFieldName : "rowKey" ,
1932+ } ,
1933+ } ) ;
1934+
1935+ // td
1936+ const firstCell = wrapper
1937+ . findAll ( ".ve-table-body-tr" )
1938+ . at ( 1 )
1939+ . findAll ( ".ve-table-body-td" )
1940+ . at ( 3 ) ;
1941+
1942+ firstCell . trigger ( "click" ) ;
1943+ firstCell . trigger ( "dblclick" ) ;
1944+
1945+ await later ( ) ;
1946+
1947+ expect ( firstCell . find ( ".ve-table-cell-selection" ) . exists ( ) ) . toBe ( true ) ;
1948+
1949+ document . dispatchEvent (
1950+ new KeyboardEvent ( "keydown" , {
1951+ keyCode : KEY_CODES . ARROW_LEFT ,
1952+ } ) ,
1953+ ) ;
1954+
1955+ await later ( ) ;
1956+
1957+ expect (
1958+ wrapper
1959+ . findAll ( ".ve-table-body-tr" )
1960+ . at ( 1 )
1961+ . findAll ( ".ve-table-body-td" )
1962+ . at ( 2 )
1963+ . find ( ".ve-table-cell-selection" )
1964+ . exists ( ) ,
1965+ ) . toBe ( true ) ;
1966+ } ) ;
1967+
19221968 it ( "cell editing with table size change and scrolling" , async ( ) => {
19231969 const wrapper = mount ( veTable , {
19241970 propsData : {
You can’t perform that action at this time.
0 commit comments