forked from juspay/hyperswitch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(cypress): add test for In Memory Cache (juspay#6961)
Co-authored-by: Sumit Kumar <[email protected]> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Kartikeya Hegde <[email protected]>
- Loading branch information
1 parent
228a36d
commit d8d8c40
Showing
3 changed files
with
127 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
35 changes: 35 additions & 0 deletions
35
cypress-tests/cypress/e2e/PaymentTest/00028-MemoryCacheConfigs.cy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import State from "../../utils/State"; | ||
|
||
let globalState; | ||
|
||
describe("In Memory Cache Test", () => { | ||
before("seed global state", () => { | ||
cy.task("getGlobalState").then((state) => { | ||
globalState = new State(state); | ||
}); | ||
}); | ||
|
||
after("flush global state", () => { | ||
cy.task("setGlobalState", globalState.data); | ||
}); | ||
|
||
context("Config flows", () => { | ||
const key = "test-key"; | ||
const value = "test value"; | ||
const newValue = "new test value"; | ||
|
||
it("Create Configs", () => { | ||
cy.createConfigs(globalState, key, value); | ||
cy.fetchConfigs(globalState, key, value); | ||
}); | ||
|
||
it("Update Configs", () => { | ||
cy.updateConfigs(globalState, key, newValue); | ||
cy.fetchConfigs(globalState, key, newValue); | ||
}); | ||
|
||
it("delete configs", () => { | ||
cy.deleteConfigs(globalState, key, newValue); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters