Fix failing feature tests

This commit is contained in:
Aditya Toshniwal 2024-03-26 11:20:04 +05:30
parent cc1ce09b73
commit c0a1429664
4 changed files with 5 additions and 22 deletions

View File

@ -73,7 +73,7 @@ export default class CustomEditorView extends EditorView {
} else {
const line = this.state.doc.line(lineNo);
pos = line.from + ch;
if(pos > line.to) {
if(ch == -1 || pos > line.to) {
pos = line.to;
}
}

View File

@ -371,24 +371,6 @@ export function MainToolBar({containerRef, onFilterClick, onManageMacros}) {
callback: ()=>{onRollbackClick();}
}
},
{
shortcut: queryToolPref.indent,
options: {
callback: ()=>{executeCmd('indentMore');}
}
},
{
shortcut: queryToolPref.unindent,
options: {
callback: ()=>{executeCmd('indentLess');}
}
},
{
shortcut: queryToolPref.comment,
options: {
callback: ()=>{executeCmd('toggleComment');}
}
},
{
shortcut: queryToolPref.toggle_case,
options: {
@ -494,7 +476,7 @@ export function MainToolBar({containerRef, onFilterClick, onManageMacros}) {
<PgIconButton title={gettext('Execute script')} icon={<PlayArrowRoundedIcon style={{height: 'unset'}} />}
onClick={executeQuery} disabled={buttonsDisabled['execute']} shortcut={queryToolPref.execute_query}/>
<PgIconButton title={gettext('Execute options')} icon={<KeyboardArrowDownIcon />} splitButton
name="menu-autocommit" ref={autoCommitMenuRef} accesskey={shortcut_key(queryToolPref.btn_delete_row)}
name="menu-autocommit" ref={autoCommitMenuRef} accesskey={shortcut_key(queryToolPref.btn_execute_options)}
onClick={toggleMenu} disabled={buttonsDisabled['execute-options']}/>
</PgButtonGroup>
<PgButtonGroup size="small">

View File

@ -412,7 +412,8 @@ export default function Query() {
const shortcutOverrideKeys = useMemo(
()=>{
const queryToolPref = queryToolCtx.preferences.sqleditor;
// omit CM internal shortcuts
const queryToolPref = _.omit(queryToolCtx.preferences.sqleditor, ['indent', 'unindent', 'comment']);
return Object.values(queryToolPref)
.filter((p)=>isShortcutValue(p))
.map((p)=>({

View File

@ -936,7 +936,7 @@ class PgadminPage:
self.driver.execute_script(
"arguments[0].cmView.view.setValue(arguments[1]);"
"arguments[0].cmView.view.setCursor("
"arguments[0].cmView.view.lineCount(),0);",
"arguments[0].cmView.view.lineCount(),-1);",
codemirror_ele, field_content)
def click_tab(self, tab_name):