Skip to content

Commit efcbe8d

Browse files
committed
test: verify auto-generated namespace and serviceAccount fields
- Added assertions for spec.namespace (should match name) - Added assertions for spec.serviceAccount.name (should be name + '-service-account') - Fully addresses test name promise to verify auto-generation - Resolves CodeRabbit major finding #1 for ClusterExtensionForm Addresses CodeRabbit review comment on PR openshift#16265
1 parent bcc157c commit efcbe8d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

frontend/packages/operator-lifecycle-manager-v1/src/components/cluster-extension/__tests__/ClusterExtensionForm.spec.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,17 @@ describe('ClusterExtensionForm', () => {
106106
await user.type(nameInput, 'my-operator');
107107

108108
await waitFor(() => expect(nameInput).toHaveValue('my-operator'));
109-
// Should call onChange with auto-generated names
109+
// Should call onChange with auto-generated namespace and service account names
110110
await waitFor(() => {
111111
expect(mockOnChange).toHaveBeenLastCalledWith(
112112
expect.objectContaining({
113113
metadata: expect.objectContaining({ name: 'my-operator' }),
114+
spec: expect.objectContaining({
115+
namespace: 'my-operator',
116+
serviceAccount: expect.objectContaining({
117+
name: 'my-operator-service-account',
118+
}),
119+
}),
114120
}),
115121
);
116122
});

0 commit comments

Comments
 (0)