Skip to content

Commit

Permalink
simplify signin check
Browse files Browse the repository at this point in the history
  • Loading branch information
yhabib committed Dec 5, 2024
1 parent d457dc0 commit 3848191
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,12 @@
const exportIcpTransactions = async () => {
// Button will only be shown if logged in
if (!(identity instanceof SignIdentity)) return;
try {
const nnsAccounts = Object.values($nnsAccountsListStore).flat();
const data = await getAccountTransactionsConcurrently({
accounts: nnsAccounts,
identity,
identity: identity as SignIdentity,
});
const datasets = buildDatasets(data);
const fileName = `icp_transactions_export_${formatDateCompact(new Date())}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import ExportIcpTransactionsButton from "$lib/components/header/ExportIcpTransac
import { authStore } from "$lib/stores/auth.store";
import * as toastsStore from "$lib/stores/toasts.store";
import * as exportToCsv from "$lib/utils/export-to-csv.utils";
import { mockPrincipal, setNoIdentity } from "$tests/mocks/auth.store.mock";
import {
mockSignInIdentity,
setNoIdentity,
} from "$tests/mocks/auth.store.mock";
import { mockAccountsStoreData } from "$tests/mocks/icp-accounts.store.mock";
import { createTransactionWithId } from "$tests/mocks/icp-transactions.mock";
import { MockLedgerIdentity } from "$tests/mocks/ledger.identity.mock";
import { ExportIcpTransactionsButtonPo } from "$tests/page-objects/ExportIcpTransactionsButton.page-object";
import { JestPageObjectElement } from "$tests/page-objects/jest.page-object";
import { setAccountsForTesting } from "$tests/utils/accounts.test-utils";
Expand All @@ -32,9 +34,6 @@ describe("ExportIcpTransactionsButton", () => {
vi.useFakeTimers();
vi.setSystemTime(mockDate);

const mockSignInIdentity = new MockLedgerIdentity({
principal: mockPrincipal,
});
authStore.setForTesting(mockSignInIdentity);

setAccountsForTesting({
Expand Down

0 comments on commit 3848191

Please sign in to comment.