Skip to content

Commit c792596

Browse files
Developerclaude
andcommitted
feat: add E2E tests and update contact controller
- Add login-test.spec.ts for login flow E2E testing - Add register-redirect.spec.ts for registration redirect test - Update contact-crud.spec.ts with complete CRUD flow tests - Update ContactController.java with contact management endpoints - Update registration screen with multi-step wizard - Move hardcoded credentials to .env.e2e environment variables - Add E2E_API_URL to environment configuration Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 1f403ac commit c792596

7 files changed

Lines changed: 399 additions & 875 deletions

File tree

apps/backend/src/main/java/com/simpleaccounts/rest/contactcontroller/ContactController.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,11 @@ public ResponseEntity<Object> update(@RequestBody ContactPersistModel contactPer
239239
}
240240
}
241241
}
242-
Map<String, Object> supplierMap = new HashMap<>();
243-
supplierMap.put("contact", contactPersistModel.getContactId());
242+
// First get the Contact entity for the query
243+
Contact existingContact = contactService.findByPK(contactPersistModel.getContactId());
244+
245+
Map<String, Object> supplierMap = new HashMap<>();
246+
supplierMap.put("contact", existingContact); // Pass Contact entity, not ID
244247
supplierMap.put(JSON_KEY_DELETE_FLAG,Boolean.FALSE);
245248
List<ContactTransactionCategoryRelation> contactTransactionCategoryRelations = contactTransactionCategoryService
246249
.findByAttributes(supplierMap);
@@ -304,7 +307,7 @@ public ResponseEntity<Object> delete(@RequestParam(value = "id") Integer id, Htt
304307
transactionCategoryList = transactionCategoryService.findByAttributes(tmap);
305308
}
306309
Map<String, Object> filterMap = new HashMap<>();
307-
filterMap.put("contact", contact.getContactId());
310+
filterMap.put("contact", contact); // Pass Contact entity, not ID
308311
// delete Contact Transaction Category Relation
309312
List<ContactTransactionCategoryRelation> contactTransactionCategoryRelations = contactTransactionCategoryService
310313
.findByAttributes(filterMap);

apps/frontend/.env.e2e

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
RUN_E2E_SMOKE=true
22
E2E_BASE_URL=http://localhost:3000
3+
E2E_API_URL=http://localhost:8080
34
E2E_USERNAME=myselfmohsin@gmail.com
4-
E2E_PASSWORD=Test@123
5+
E2E_PASSWORD=Test@123$
56
E2E_LOGIN_PATH=/login
67
E2E_POST_LOGIN_PATH=/admin
78
E2E_INVOICE_PATH=/admin/income/customer-invoice

0 commit comments

Comments
 (0)