Skip to content

Commit

Permalink
chore(test): fix tests (#1448)
Browse files Browse the repository at this point in the history
  • Loading branch information
silvester-pari authored Dec 19, 2024
1 parent 9b09ec9 commit 1782671
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion elements/timecontrol/test/cases/load-date-format.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
import { html } from "lit";
import { TEST_SELECTORS } from "../../src/enums";
import "../_mockMap";

// Destructure TEST_SELECTORS object
const { timeControl } = TEST_SELECTORS;

const testValues = ["2024-12-17"];

/**
* Test to verify if the date format is applied correctly.
*/
const loadDateFormatTest = () => {
cy.mount("<mock-map></mock-map>").as("mock-map");
cy.mount(
`<eox-timecontrol for="mock-map" display-format="DD/MM/YYYY" layer="TEST_ID"></eox-timecontrol>`,
html`<eox-timecontrol
for="mock-map"
display-format="DD/MM/YYYY"
layer="TEST_ID"
.controlValues=${testValues}
></eox-timecontrol>`,
).as(timeControl);

cy.get(timeControl).shadow().find("#controls span").contains("17/12/2024");
Expand Down
4 changes: 2 additions & 2 deletions elements/timecontrol/test/general.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ import {

describe("TimeControl", () => {
it("loads the timecontrol", () => loadTimeControlTest());
it.only("changes the time correctly", () => changeTimeTest());
it.only("loads the date format correctly", () => loadDateFormatTest());
it("changes the time correctly", () => changeTimeTest());
it("loads the date format correctly", () => loadDateFormatTest());
});

0 comments on commit 1782671

Please sign in to comment.