Skip to content

Commit acbe7a9

Browse files
committed
fix: nanofixes
1 parent 9fef0e2 commit acbe7a9

3 files changed

Lines changed: 33 additions & 2 deletions

File tree

src/containers/Tenant/Diagnostics/StorageUsage/StorageUsage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function StorageUsage({path, database, databaseFullPath}: StorageUsageProps) {
7474
const rows = storageUsageData?.rows ?? EMPTY_STORAGE_USAGE_ROWS;
7575
const normalizedDataSize = Number(dataSize);
7676
const sectionDataSize =
77-
Number.isFinite(normalizedDataSize) && normalizedDataSize > 0
77+
Number.isFinite(normalizedDataSize) && normalizedDataSize >= 0
7878
? normalizedDataSize
7979
: undefined;
8080

tests/suites/tenant/diagnostics/Diagnostics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ export class Diagnostics {
351351
}
352352

353353
getTab(tabName: DiagnosticsTab): Locator {
354-
return this.tabs.locator(`button[data-tab="${tabName}"]`);
354+
return this.tabs.locator(`a[data-tab="${tabName}"]`);
355355
}
356356

357357
async clickTab(tabName: DiagnosticsTab): Promise<void> {

tests/suites/tenant/diagnostics/tabs/storageUsage.test.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,37 @@ test.describe('Diagnostics Storage usage tab', async () => {
415415
await expect(storageUsageSections.getByText('5x', {exact: true})).toHaveCount(0);
416416
});
417417

418+
test('Storage usage shows zero data size when table stats report 0 bytes', async ({page}) => {
419+
await setupStorageUsageMocks({
420+
page,
421+
path: MOCK_STORAGE_USAGE_MEDIA_STATS_PATH,
422+
dataSize: '0',
423+
storageSize: 100000000000,
424+
rows: [{GroupId: '2181040008', StorageSize: 100000000000, StorageCount: 10}],
425+
groups: [
426+
{
427+
GroupId: '2181040008',
428+
Limit: '2000000000000',
429+
MediaType: 'SSD',
430+
ErasureSpecies: 'mirror-3-dc',
431+
},
432+
],
433+
});
434+
435+
const tenantPage = new TenantPage(page);
436+
await tenantPage.goto({
437+
schema: MOCK_STORAGE_USAGE_MEDIA_STATS_PATH,
438+
database,
439+
tenantPage: 'diagnostics',
440+
diagnosticsTab: 'storageUsage',
441+
});
442+
443+
const storageUsage = page.locator('.ydb-storage-usage');
444+
445+
await expect(storageUsage).toBeVisible();
446+
await expect(storageUsage.getByText(/^0\s*GB$/, {exact: true})).toBeVisible();
447+
});
448+
418449
test('Storage usage shows response error when storage groups request fails', async ({page}) => {
419450
await setupStorageUsageMocks({
420451
page,

0 commit comments

Comments
 (0)