Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/routes/vaults/protocols/[protocol=slug]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@
showFilters
showUnknownFilter={false}
{defaultTvlKey}
defaultSort={data.protocolSlug === 'apex' ? 'tvl' : undefined}
defaultDirection={data.protocolSlug === 'apex' ? 'desc' : undefined}
defaultHideUnknown={isUnknownVaultProtocolGroup ? 0 : 1}
>
{#snippet detailAside()}
Expand Down
13 changes: 13 additions & 0 deletions tests/integration/vaults/protocol-detail.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { expect, test } from '@playwright/test';

test.describe('vault protocol detail pages', () => {
test('sorts ApeX vaults by TVL by default', async ({ page }) => {
await page.goto('/vaults/protocols/apex');

const rows = page.locator('tbody tr.targetable');
await expect(rows).toHaveCount(2);
await expect(rows.first()).toContainText('ApeX high TVL vault');
await expect(rows.nth(1)).toContainText('ApeX high return vault');
await expect(page.locator('thead th.tvl svg')).toBeVisible();
});
});
22 changes: 22 additions & 0 deletions tests/mocks/top-vaults/list.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,27 @@ const limitedCoverageVault = createTestVault('Limited coverage vault', {
]
});

const apexVaults = [
createTestVault('ApeX high TVL vault', {
address: '0x1000000000000000000000000000000000000001',
chain: 'apex',
protocol: 'ApeX',
current_nav: 9_000,
peak_nav: 10_000,
one_month_cagr: 0.01,
three_months_cagr: 0.01
}),
createTestVault('ApeX high return vault', {
address: '0x1000000000000000000000000000000000000002',
chain: 'apex',
protocol: 'ApeX',
current_nav: 1_000,
peak_nav: 1_500,
one_month_cagr: 0.5,
three_months_cagr: 0.5
})
];

// Named vault for YAML strategy integration tests
const yamlStrategyVault = createTestVault('Trading Strategy ICHIv3 LS 2', {
address: '0x1234567890abcdef1234567890abcdef12345678',
Expand Down Expand Up @@ -520,6 +541,7 @@ export default defineMock({
redemptionDisabledVault,
depositAndRedemptionDisabledVault,
limitedCoverageVault,
...apexVaults,
...parquetMatchedVaults,
...returnLeaders,
...belowTvl,
Expand Down
Loading