Skip to content

Commit

Permalink
add missing test combination
Browse files Browse the repository at this point in the history
  • Loading branch information
yhabib committed Jan 23, 2025
1 parent 8f14282 commit 366292a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions frontend/src/tests/lib/pages/Portfolio.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,7 @@ describe("Portfolio page", () => {
isStakeLoading: true,
};

// Test Case 1: Initial loading state - both tokens and projects loading
let po = renderPage({
userTokens: [loadingToken],
tableProjects: [loadingProject],
Expand All @@ -552,6 +553,8 @@ describe("Portfolio page", () => {
balanceInUsd: 100,
universeId: principal(1),
});

// Test Case 2: Partial loading state - tokens loaded, projects still loading
po = renderPage({
userTokens: [loadedToken],
tableProjects: [loadingProject],
Expand All @@ -571,6 +574,21 @@ describe("Portfolio page", () => {
isStakeLoading: false,
};

// Test Case 3: Partial loading state - projects loaded, tokens still loading
po = renderPage({
userTokens: [loadingToken],
tableProjects: [loadedProject],
});

expect(await po.getTotalAssetsCardPo().hasSpinner()).toEqual(true);
expect(await po.getHeldTokensSkeletonCard().isPresent()).toEqual(true);
expect(await po.getStakedTokensSkeletonCard().isPresent()).toEqual(
false
);
expect(await po.getHeldTokensCardPo().isPresent()).toEqual(false);
expect(await po.getStakedTokensCardPo().isPresent()).toEqual(true);

// Test Case 4: Fully loaded state - both tokens and projects loaded
po = renderPage({
userTokens: [loadedToken],
tableProjects: [loadedProject],
Expand Down

0 comments on commit 366292a

Please sign in to comment.