Skip to content

Commit

Permalink
Merge branch 'feature/update-test' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Ho3einWave committed Jan 7, 2025
2 parents e43142c + 1db7183 commit 94f13be
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions cypress/e2e/base.cy.ts
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
describe("swap tests", () => {
describe('swap tests', () => {
beforeEach(() => {
cy.visit(
"http://localhost:6006/iframe.html?args=&globals=&id=components-swap--default&viewMode=story"
'http://localhost:6006/iframe.html?args=&globals=&id=components-swap--default&viewMode=story'
);
});
it("should be able to swap ston with right dex", () => {
it('should be able to swap ston with right dex', () => {
cy.get("[data-testid='card-button-receive']").click();
cy.get("[data-testid='dialog-search-input']").type("STON");
cy.get("[data-testid='dialog-search-input']").type('STON');
cy.get(
"[data-testid='EQA2kCVNwVsil2EM2mB0SkXytxCqQjS4mttjDpnXmwG9T6bO']"
).click();
cy.get("[data-testid='swapcard-input-pay']").type("100");
cy.get("[data-testid='swapcard-input-pay']").type('100');
cy.get("[data-testid='swap-details']").click();
cy.get("[data-testid='dex-container']").should(
"contain.text",
"Ston.fi"
'contain.text',
'StonFi'
);
});
it("should be able to swap scale with right dex", () => {
it('should be able to swap scale with right dex', () => {
cy.get("[data-testid='card-button-receive']").click();
cy.get("[data-testid='dialog-search-input']").type("SCALE");
cy.get("[data-testid='dialog-search-input']").type('SCALE');
cy.get(
"[data-testid='EQBlqsm144Dq6SjbPI4jjZvA1hqTIP3CvHovbIfW_t-SCALE']"
).click();
cy.get("[data-testid='swapcard-input-pay']").type("100");
cy.get("[data-testid='swapcard-input-pay']").type('100');
cy.get("[data-testid='swap-details']").click();
cy.get("[data-testid='dex-container']").should(
"contain.text",
"Dedust"
'contain.text',
'Dedust'
);
});
it("output should get price impact when input amount is too high", () => {
it('output should get price impact when input amount is too high', () => {
cy.get("[data-testid='card-button-receive']").click();
cy.get("[data-testid='dialog-search-input']").type("SCALE");
cy.get("[data-testid='dialog-search-input']").type('SCALE');
cy.get(
"[data-testid='EQBlqsm144Dq6SjbPI4jjZvA1hqTIP3CvHovbIfW_t-SCALE']"
).click();
cy.get("[data-testid='swapcard-input-pay']").type("10000");
cy.get("[data-testid='swapcard-input-pay']").type('10000');
cy.get("[data-testid='swap-details']").click();
cy.wait(1000);
cy.get("[data-testid='price-impact']")
.invoke("text")
.invoke('text')
.then((text) => {
const impact = parseFloat(text.replace("%", ""));
const impact = parseFloat(text.replace('%', ''));
expect(impact).to.be.greaterThan(90);
});
});
Expand Down

0 comments on commit 94f13be

Please sign in to comment.