Skip to content

Commit

Permalink
web-wallet: Update Wallet Access terminology
Browse files Browse the repository at this point in the history
Resolves #3356
  • Loading branch information
nortonandreev committed Jan 14, 2025
1 parent 9e291c8 commit ecb9687
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 25 deletions.
4 changes: 3 additions & 1 deletion web-wallet/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Update Transactions list design [#1922]
- Ensure connected wallet is disconnected when closing the app [#3269]
- Update Wallet Access terminology [#3356]

### Removed

Expand Down Expand Up @@ -516,11 +517,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#3259]: https://github.com/dusk-network/rusk/issues/3259
[#3265]: https://github.com/dusk-network/rusk/issues/3265
[#3267]: https://github.com/dusk-network/rusk/issues/3267
[#3270]: https://github.com/dusk-network/rusk/issues/3269
[#3269]: https://github.com/dusk-network/rusk/issues/3269
[#3270]: https://github.com/dusk-network/rusk/issues/3270
[#3287]: https://github.com/dusk-network/rusk/issues/3287
[#3333]: https://github.com/dusk-network/rusk/issues/3333
[#3339]: https://github.com/dusk-network/rusk/issues/3339
[#3356]: https://github.com/dusk-network/rusk/issues/3356

<!-- VERSIONS -->

Expand Down
6 changes: 5 additions & 1 deletion web-wallet/src/routes/(app)/settings/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,11 @@
icon={{ path: mdiArrowLeft }}
text="Back"
/>
<Button on:click={() => logout(false)} variant="tertiary" text="Log out" />
<Button
on:click={() => logout(false)}
variant="tertiary"
text="Lock Wallet"
/>
</div>

<style lang="postcss">
Expand Down
4 changes: 2 additions & 2 deletions web-wallet/src/routes/(app)/settings/__tests__/page.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ describe("Settings", () => {
expect(backButton).toHaveAttribute("aria-disabled", "false");
});

it("should reset wallet store and navigate to login page on clicking the Log Out button", async () => {
it("should reset wallet store and navigate to landing page on clicking the Lock Wallet button", async () => {
const { getByRole } = render(Settings);

const button = getByRole("button", { name: "Log out" });
const button = getByRole("button", { name: "Lock Wallet" });

await fireEvent.click(button);
await vi.advanceTimersToNextTimerAsync();
Expand Down
4 changes: 2 additions & 2 deletions web-wallet/src/routes/(welcome)/setup/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
</div>
<Animation />
<AppAnchorButton
href="/login"
text="Access wallet"
href="/unlock"
text="Unlock Wallet"
icon={{ path: mdiKeyOutline }}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ exports[`Setup > should render the Setup page 1`] = `
<a
aria-disabled="false"
class="dusk-anchor dusk-anchor--on-surface dusk-anchor-button dusk-anchor-button--variant--primary dusk-anchor-button--size--default dusk-icon-button--labeled"
href="/some-base-path/login"
href="/some-base-path/unlock"
>
<svg
class="dusk-icon dusk-icon--size--default dusk-anchor-button__icon"
Expand All @@ -134,7 +134,7 @@ exports[`Setup > should render the Setup page 1`] = `
<span
class="dusk-anchor-button__text"
>
Access wallet
Unlock Wallet
</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Login > Mnemonic phrase workflow > should render the login page and show the field to enter the mnemonic phrase, if there is no login info stored 1`] = `
exports[`Unlock Wallet > Mnemonic phrase workflow > should render the Unlock Wallet page and show the field to enter the mnemonic phrase, if there is no login info stored 1`] = `
<section
class="login svelte-1e8gc2s"
>
Expand Down Expand Up @@ -126,7 +126,7 @@ exports[`Login > Mnemonic phrase workflow > should render the login page and sho
</section>
`;

exports[`Login > Password workflow > should show the password field and the link to restore the wallet if there is login info stored 1`] = `
exports[`Unlock Wallet > Password workflow > should show the password field and the link to restore the wallet if there is login info stored 1`] = `
<section
class="login svelte-1e8gc2s"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
} from "$lib/wallet";
import loginInfoStorage from "$lib/services/loginInfoStorage";

import Login from "../+page.svelte";
import UnlockWallet from "../+page.svelte";

/** @param {HTMLElement} container */
function getTextInput(container) {
Expand All @@ -34,7 +34,7 @@ function getTextInput(container) {
);
}

describe("Login", async () => {
describe("Unlock Wallet", async () => {
const mnemonic = generateMnemonic();
const pwd = "some pwd";
const loginInfo = await encryptMnemonic(mnemonic, pwd);
Expand Down Expand Up @@ -70,14 +70,14 @@ describe("Login", async () => {
});

describe("Mnemonic phrase workflow", () => {
it("should render the login page and show the field to enter the mnemonic phrase, if there is no login info stored", () => {
const { container } = render(Login, {});
it("should render the Unlock Wallet page and show the field to enter the mnemonic phrase, if there is no login info stored", () => {
const { container } = render(UnlockWallet, {});

expect(container.firstChild).toMatchSnapshot();
});

it("should show an error message if the user enters an invalid mnemonic", async () => {
const { container } = render(Login, {});
const { container } = render(UnlockWallet, {});
const form = getAsHTMLElement(container, "form");
const textInput = getTextInput(container);

Expand All @@ -99,7 +99,7 @@ describe("Login", async () => {
});

it("should redirect to the Restore flow if the user inputs a valid mnemonic with no prior wallet created", async () => {
const { container } = render(Login, {});
const { container } = render(UnlockWallet, {});
const form = getAsHTMLElement(container, "form");
const textInput = getTextInput(container);

Expand All @@ -116,7 +116,7 @@ describe("Login", async () => {
const currentUserID = "some-user-id";
settingsStore.update(setKey("userId", currentUserID));

const { container } = render(Login, {});
const { container } = render(UnlockWallet, {});
const form = getAsHTMLElement(container, "form");
const textInput = getTextInput(container);

Expand All @@ -132,7 +132,7 @@ describe("Login", async () => {
it("should unlock the Wallet if the entered mnemonic is the last one used", async () => {
settingsStore.update(setKey("userId", userId));

const { container } = render(Login, {});
const { container } = render(UnlockWallet, {});
const form = getAsHTMLElement(container, "form");
const textInput = getTextInput(container);

Expand All @@ -150,7 +150,7 @@ describe("Login", async () => {
it("should trim and lower case the entered mnemonic before validating it", async () => {
settingsStore.update(setKey("userId", userId));

const { container } = render(Login, {});
const { container } = render(UnlockWallet, {});
const form = getAsHTMLElement(container, "form");
const textInput = getTextInput(container);

Expand All @@ -176,13 +176,13 @@ describe("Login", async () => {
});

it("should show the password field and the link to restore the wallet if there is login info stored", () => {
const { container } = render(Login, {});
const { container } = render(UnlockWallet, {});

expect(container.firstChild).toMatchSnapshot();
});

it("should show an error message if the user enters the wrong password", async () => {
const { container } = render(Login, {});
const { container } = render(UnlockWallet, {});
const form = getAsHTMLElement(container, "form");
const textInput = getTextInput(container);

Expand Down Expand Up @@ -210,7 +210,7 @@ describe("Login", async () => {
it("should redirect to the Restore flow if the user inputs the correct password with no prior wallet created", async () => {
settingsStore.update(setKey("userId", ""));

const { container } = render(Login, {});
const { container } = render(UnlockWallet, {});
const form = getAsHTMLElement(container, "form");
const textInput = getTextInput(container);

Expand All @@ -237,7 +237,7 @@ describe("Login", async () => {

settingsStore.update(setKey("userId", currentUserID));

const { container } = render(Login, {});
const { container } = render(UnlockWallet, {});
const form = getAsHTMLElement(container, "form");
const textInput = getTextInput(container);

Expand All @@ -256,7 +256,7 @@ describe("Login", async () => {
it("should unlock the Wallet is the entered password is for the last used mnemonic", async () => {
settingsStore.update(setKey("userId", userId));

const { container } = render(Login, {});
const { container } = render(UnlockWallet, {});
const form = getAsHTMLElement(container, "form");
const textInput = getTextInput(container);

Expand All @@ -274,7 +274,7 @@ describe("Login", async () => {
it("should trim the entered password before validating it", async () => {
settingsStore.update(setKey("userId", userId));

const { container } = render(Login, {});
const { container } = render(UnlockWallet, {});
const form = getAsHTMLElement(container, "form");
const textInput = getTextInput(container);

Expand Down

0 comments on commit ecb9687

Please sign in to comment.