This repository has been archived by the owner on Aug 1, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): wire up settings endpoints (#390)
Closes #385 *** * feat: wire up settings endpoints * Make theme depend on settings * Improve theme handling * Add settings test spec * Adjust to new cypress command
- Loading branch information
Showing
17 changed files
with
203 additions
and
75 deletions.
There are no files selected for viewing
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
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,39 @@ | ||
context("settings", () => { | ||
beforeEach(() => { | ||
cy.nukeCache(); | ||
cy.nukeSessionState(); | ||
cy.createIdentity(); | ||
|
||
cy.visit("public/index.html"); | ||
cy.pick("sidebar", "settings").click(); | ||
}); | ||
|
||
context("theme", () => { | ||
it("is set to the default", () => { | ||
cy.get("[data-theme='light']").should("exist"); | ||
}); | ||
|
||
it("can be switched to dark", () => { | ||
cy.get("button[value='dark']").click(); | ||
cy.get("[data-theme='dark']").should("exist"); | ||
}); | ||
}); | ||
|
||
context("session", () => { | ||
it("state can be cleared", () => { | ||
cy.pick("clear-session-button").click(); | ||
cy.pick("get-started-button").should("exist"); | ||
}); | ||
|
||
it("cache can be cleared", () => { | ||
// Prepare transaction center. | ||
cy.registerUser(); | ||
cy.get("body").type("{shift}T"); | ||
cy.pick("transaction-center").should("exist"); | ||
|
||
// Clear cache. | ||
cy.pick("clear-cache-button").click(); | ||
cy.pick("transaction-center").should("not.exist"); | ||
}); | ||
}); | ||
}); |
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
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
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
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
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
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
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
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
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
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,9 @@ | ||
<script> | ||
import { settings } from "./src/session.ts"; | ||
import { Theme } from "./src/settings.ts"; | ||
$: { | ||
const theme = $settings ? $settings.appearance.theme : Theme.Light; | ||
document.documentElement.setAttribute("data-theme", theme); | ||
} | ||
</script> |
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
Oops, something went wrong.