refactor(core): use overcapacityMemberCount for quota checking instead of calculating the difference (#12117)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved accuracy of member quota warnings by updating the logic that detects when the member limit has been exceeded. - Enhanced test reliability by adjusting member list pagination test to better handle confirmation modals. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -57,8 +57,7 @@ export const QuotaCheck = ({
|
|||||||
if (workspaceMeta.flavour === 'local' || !quota || isTeam) {
|
if (workspaceMeta.flavour === 'local' || !quota || isTeam) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const memberOverflow = quota.memberCount > quota.memberLimit;
|
const memberOverflow = quota.overcapacityMemberCount > 0;
|
||||||
// remember to use real percent
|
|
||||||
const storageOverflow = usedPercent && usedPercent >= 100;
|
const storageOverflow = usedPercent && usedPercent >= 100;
|
||||||
const message = getSyncPausedMessage(
|
const message = getSyncPausedMessage(
|
||||||
!!isOwner,
|
!!isOwner,
|
||||||
|
|||||||
@@ -62,8 +62,6 @@ test('should have pagination in member list', async ({ page }) => {
|
|||||||
|
|
||||||
await page.waitForTimeout(1000);
|
await page.waitForTimeout(1000);
|
||||||
|
|
||||||
await page.getByTestId('confirm-modal-cancel').click();
|
|
||||||
|
|
||||||
const firstPageMemberItemCount = await page
|
const firstPageMemberItemCount = await page
|
||||||
.locator('[data-testid="member-item"]')
|
.locator('[data-testid="member-item"]')
|
||||||
.count();
|
.count();
|
||||||
|
|||||||
Reference in New Issue
Block a user