Skip to content

Commit

Permalink
Fix code scanning alert no. 117: Incomplete string escaping or encoding
Browse files Browse the repository at this point in the history
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 7e7ac79 commit 1a61309
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions cypress/support/util/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import {
api,
} from '@pagerduty/pdjs';
import cssesc from 'cssesc';

export const pd = api({ token: Cypress.env('PD_USER_TOKEN') });

Expand Down Expand Up @@ -278,8 +279,8 @@ export const manageCustomColumnDefinitions = (customColumnDefinitions, type = 'a
cy.get('button[aria-label="Add custom column"]').click();
// Need to escape special characters in accessorPath
// https://docs.cypress.io/faq/questions/using-cypress-faq#How-do-I-use-special-characters-with-cyget
const columnId = Cypress.$.escapeSelector(
[header, accessorPath, expression.replace(/:/g, '\\:')]
const columnId = cssesc(
[header, accessorPath, expression]
.filter((value) => value !== '')
.join(':'),
);
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
"styled-components": "^6.0.4",
"use-debounce": "^9.0.3",
"validator": "^13.12.0",
"web-vitals": "^3.5.2"
"web-vitals": "^3.5.2",
"cssesc": "^3.0.0"
},
"scripts": {
"start": "vite",
Expand Down

0 comments on commit 1a61309

Please sign in to comment.