diff --git a/cvat-ui/src/components/annotation-page/top-bar/filters-modal.tsx b/cvat-ui/src/components/annotation-page/top-bar/filters-modal.tsx index ee550bc5..7c7f9705 100644 --- a/cvat-ui/src/components/annotation-page/top-bar/filters-modal.tsx +++ b/cvat-ui/src/components/annotation-page/top-bar/filters-modal.tsx @@ -261,6 +261,7 @@ function FiltersModalComponent(): JSX.Element { visible={visible} closable={false} width={800} + destroyOnClose centered onCancel={() => dispatch(showFilters(false))} footer={[ diff --git a/tests/cypress/integration/actions_objects/case_36_always_show_object_details_feature.js b/tests/cypress/integration/actions_objects/case_36_always_show_object_details_feature.js index 9f9c0e11..566d82f5 100644 --- a/tests/cypress/integration/actions_objects/case_36_always_show_object_details_feature.js +++ b/tests/cypress/integration/actions_objects/case_36_always_show_object_details_feature.js @@ -11,7 +11,7 @@ context('Always show object details feature', () => { const rectangleShape2Points = { points: 'By 2 Points', type: 'Shape', - labelName: labelName, + labelName, firstX: 400, firstY: 100, secondX: 500, @@ -20,7 +20,7 @@ context('Always show object details feature', () => { const polygonTrack = { reDraw: false, type: 'Track', - labelName: labelName, + labelName, pointsMap: [ { x: 400, y: 300 }, { x: 500, y: 300 }, diff --git a/tests/cypress/integration/actions_tasks3/case_19_all_image_rotate_features.js b/tests/cypress/integration/actions_tasks3/case_19_all_image_rotate_features.js index 4c85d2ae..33b8de9b 100644 --- a/tests/cypress/integration/actions_tasks3/case_19_all_image_rotate_features.js +++ b/tests/cypress/integration/actions_tasks3/case_19_all_image_rotate_features.js @@ -9,6 +9,10 @@ import { taskName } from '../../support/const'; context('Rotate all images feature.', () => { const caseId = '19'; + function checkDegRotate(deg) { + cy.get('#cvat_canvas_background').should('have.attr', 'style').and('contain', `rotate(${deg}deg);`); + } + function imageRotate(direction = 'anticlockwise', deg) { cy.get('.cvat-rotate-canvas-control').trigger('mouseover'); if (direction === 'clockwise') { @@ -19,10 +23,6 @@ context('Rotate all images feature.', () => { checkDegRotate(deg); } - function checkDegRotate(deg) { - cy.get('#cvat_canvas_background').should('have.attr', 'style').and('contain', `rotate(${deg}deg);`); - } - function checkFrameNum(frameNum) { cy.get('.cvat-player-frame-selector').within(() => { cy.get('input[role="spinbutton"]').should('have.value', frameNum); @@ -40,7 +40,7 @@ context('Rotate all images feature.', () => { imageRotate('anticlockwise', 270); }); - it("Go to the next frame. It wasn't rotated.", () => { + it('Go to the next frame. It wasn\'t rotated.', () => { cy.get('.cvat-player-next-button').click(); checkFrameNum(1); checkDegRotate(0); diff --git a/tests/cypress/integration/issues_prs2/issue_1439_blocked_object_info.js b/tests/cypress/integration/issues_prs2/issue_1439_blocked_object_info.js index 7779df8f..00066f4d 100644 --- a/tests/cypress/integration/issues_prs2/issue_1439_blocked_object_info.js +++ b/tests/cypress/integration/issues_prs2/issue_1439_blocked_object_info.js @@ -11,7 +11,7 @@ context('Information about a blocked object disappears if hover the cursor over const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', - labelName: labelName, + labelName, firstX: 250, firstY: 350, secondX: 350, @@ -20,7 +20,7 @@ context('Information about a blocked object disappears if hover the cursor over const createRectangleShape2PointsSecond = { points: 'By 2 Points', type: 'Shape', - labelName: labelName, + labelName, firstX: createRectangleShape2Points.firstX, firstY: createRectangleShape2Points.firstY - 150, secondX: createRectangleShape2Points.secondX, diff --git a/tests/cypress/support/commands_filters_feature.js b/tests/cypress/support/commands_filters_feature.js index b61b08b2..a2ae6d54 100644 --- a/tests/cypress/support/commands_filters_feature.js +++ b/tests/cypress/support/commands_filters_feature.js @@ -14,7 +14,7 @@ Cypress.Commands.add('сheckFiltersModalOpened', () => { }); Cypress.Commands.add('collectGroupID', () => { - let groupDataID = []; + const groupDataID = []; cy.get('.group').then(($group) => { for (let i = 0; i < $group.length; i++) { groupDataID.push($group[i].dataset.id); @@ -24,7 +24,7 @@ Cypress.Commands.add('collectGroupID', () => { }); Cypress.Commands.add('collectRuleID', () => { - let ruleDataID = []; + const ruleDataID = []; cy.get('.rule').then(($rule) => { for (let i = 0; i < $rule.length; i++) { ruleDataID.push($rule[i].dataset.id); @@ -37,7 +37,7 @@ Cypress.Commands.add('clearFilters', () => { cy.сheckFiltersModalOpened(); cy.contains('button', 'Clear filters').click(); cy.get('.cvat-filters-modal-visible').should('not.exist'); - cy.get('.cvat-filters-modal').should('be.hidden'); + cy.get('.cvat-filters-modal').should('not.exist'); }); Cypress.Commands.add('addFiltersGroup', (groupIndex) => { @@ -66,7 +66,9 @@ Cypress.Commands.add('setGroupCondition', (groupIndex, condition) => { Cypress.Commands.add( 'setFilter', - ({ groupIndex, ruleIndex, field, operator, valueSource, value, label, labelAttr, submit }) => { + ({ + groupIndex, ruleIndex, field, operator, valueSource, value, label, labelAttr, submit, + }) => { cy.сheckFiltersModalOpened(); cy.collectGroupID().then((groupIdIndex) => { cy.collectRuleID().then((ruleIdIndex) => { @@ -104,16 +106,14 @@ Cypress.Commands.add( .within(() => { if (field === 'Attributes') { cy.get('[placeholder="Enter string"]').last().type(`${value}{Enter}`); - } else { - if (!valueSource) { - if (field === 'ObjectID' || field === 'Width' || field === 'Height') { - cy.get('[placeholder="Enter number"]').type(`${value}{Enter}`); - } else { - cy.get('[type="search"]').last().type(`${value}{Enter}`); - } + } else if (!valueSource) { + if (field === 'ObjectID' || field === 'Width' || field === 'Height') { + cy.get('[placeholder="Enter number"]').type(`${value}{Enter}`); } else { - cy.contains('[type="button"]', 'Select field ').click(); + cy.get('[type="search"]').last().type(`${value}{Enter}`); } + } else { + cy.contains('[type="button"]', 'Select field ').click(); } }); if (valueSource) { @@ -124,7 +124,7 @@ Cypress.Commands.add( cy.contains('button', 'Submit').click(); }); cy.get('.cvat-filters-modal-visible').should('not.exist'); - cy.get('.cvat-filters-modal').should('be.hidden'); + cy.get('.cvat-filters-modal').should('not.exist'); } }); }); @@ -143,5 +143,5 @@ Cypress.Commands.add('selectFilterValue', (filterValue) => { cy.contains('button', 'Submit').click(); }); cy.get('.cvat-filters-modal-visible').should('not.exist'); - cy.get('.cvat-filters-modal').should('be.hidden'); + cy.get('.cvat-filters-modal').should('not.exist'); });