Kuadrant / Kuadrant/kuadrant-console-plugin

E2E: Policy test comment mismatch

Open
#769 5 comments 0 reactions 1 assignee Claimed by @Rahul-pamula View on GitHub
e2e good first issue tests triage/accepted
Dominant language
TypeScript
Stars
10
Forks
65
Avg merge
2d 8h
Merged PRs (30d)
44

Description

## Description

Comment says "remove existing limit and add updated one" but the test code only adds a new `updated` limit. The test assertion only checks the new limit exists, not that `default` was removed.

## Current Behaviour

```typescript
// remove existing limit and add updated one ← comment says "remove"
await page.getByRole('button', { name: 'Add Limit' }).click();
// ... adds 'updated' limit ...

expect(
kubectl(['get', 'tokenratelimitpolicy', policyName, '-n', namespace, '-o', 'jsonpath={.spec.limits.updated.rates[0].limit}'])
).toBe('200');
// ❌ No assertion that 'default' was removed
```

## Expected Behaviour

**Option 1:** Update comment to match behavior:
```typescript
// add the updated limit; the form replaces previous limits on save
```

**Option 2:** Add assertion that old limit is gone:
```typescript
expect(
kubectl(['get', 'tokenratelimitpolicy', policyName, '-n', namespace, '-o', 'jsonpath={.spec.limits.default}'])
).toBe('');
```

## Location

`e2e/tests/policy-forms.spec.ts:818-845`

## Related

CodeRabbit comment in PR #734

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.