Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Updated js file to ts files #37312

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
locators,
templates,
} from "../../../../support/Objects/ObjectsCore";
import reconnectDatasourceLocators from "../../../../locators/ReconnectLocators.js";
import reconnectDatasourceLocators from "../../../../locators/ReconnectLocators";

describe(
"Create new application from template",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
} from "../../../../../support/Objects/ObjectsCore";
import PageList from "../../../../../support/Pages/PageList";
const templateLocators = require("../../../../../locators/TemplatesLocators.json");
import reconnectDatasourceLocators from "../../../../../locators/ReconnectLocators.js";
import reconnectDatasourceLocators from "../../../../../locators/ReconnectLocators";

describe(
"Bug 17276 - Templates modal filtering",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
const fieldPrefix = ".t--jsonformfield";
const backBtn = "[data-testid='t--property-pane-back-btn']";

function hideAndVerifyProperties(fieldName, fieldValue, resolveFieldValue) {
function hideAndVerifyProperties(fieldName, fieldValue, resolveFieldValue?) {
// Check if visible
cy.get(`${fieldPrefix}-${fieldName}`).should("exist");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
const fieldPrefix = ".t--jsonformfield";
const backBtn = "[data-testid='t--property-pane-back-btn']";

function hideAndVerifyProperties(fieldName, fieldValue, resolveFieldValue) {
function hideAndVerifyProperties(fieldName, fieldValue, resolveFieldValue?) {
// Check if visible
cy.get(`${fieldPrefix}-${fieldName}`).should("exist");

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Use data- attributes for selectors*

Current selectors don't follow best practices. Replace class-based and attribute selectors with data-* attributes.

Examples:

- .bp3-ui-text
+ [data-testid="form-text"]

- ${fieldPrefix}-${fieldName}
+ [data-testid="json-form-field-${fieldName}"]

Also, consider creating a dedicated locators file for JSON form-specific selectors to improve maintainability.

Also applies to: 39-39, 47-47, 66-66

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ describe(
.eq(1)
.invoke("text")
.then((cardNo) => {
var format = /^\d{4}-\d{4}-\d{4}(-\d{4})?$/;
let format = /^\d{4}-\d{4}-\d{4}(-\d{4})?$/;
expect(cardNumber).match(format);
expect(cardNumber).to.be.equal(cardNo);
});
Expand Down
Loading
Loading