forked from jsnbuchanan/crowd-funder-for-time-pwa
test: enhance deep link testing with real JWT examples
Changes: - Add real JWT example for invite testing - Add detailed JWT payload documentation - Update test-deeplinks.sh with valid claim IDs - Add test case for single contact invite - Improve test descriptions and organization This improves test coverage by using real-world JWT examples and valid claim identifiers.
This commit is contained in:
@@ -145,28 +145,28 @@ import { Contact, ContactMethod } from "../db/tables/contacts";
|
||||
/**
|
||||
* Contact Edit View Component
|
||||
* @author Matthew Raymer
|
||||
*
|
||||
*
|
||||
* This component provides a full-featured contact editing interface with support for:
|
||||
* - Basic contact information (name, notes)
|
||||
* - Multiple contact methods with type selection
|
||||
* - Data validation and persistence
|
||||
*
|
||||
*
|
||||
* Workflow:
|
||||
* 1. Component loads with DID from route params
|
||||
* 2. Fetches existing contact data from IndexedDB
|
||||
* 3. Presents editable form with current values
|
||||
* 4. Validates and saves updates back to database
|
||||
*
|
||||
*
|
||||
* Contact Method Types:
|
||||
* - CELL: Mobile phone numbers
|
||||
* - EMAIL: Email addresses
|
||||
* - WHATSAPP: WhatsApp contact info
|
||||
*
|
||||
*
|
||||
* State Management:
|
||||
* - Maintains separate state for form fields to prevent direct mutation
|
||||
* - Handles array cloning for contact methods to prevent reference issues
|
||||
* - Manages dropdown state for method type selection
|
||||
*
|
||||
*
|
||||
* Navigation:
|
||||
* - Back button returns to previous view
|
||||
* - Save redirects to contact detail view
|
||||
@@ -207,13 +207,13 @@ export default class ContactEditView extends Vue {
|
||||
|
||||
/**
|
||||
* Component lifecycle hook that initializes the contact edit form
|
||||
*
|
||||
*
|
||||
* Workflow:
|
||||
* 1. Extracts DID from route parameters
|
||||
* 2. Queries database for existing contact
|
||||
* 3. Populates form fields with contact data
|
||||
* 4. Handles missing contact error case
|
||||
*
|
||||
*
|
||||
* @throws Will not throw but redirects on error
|
||||
* @emits Notification on contact not found
|
||||
* @emits Router navigation on error
|
||||
@@ -240,7 +240,7 @@ export default class ContactEditView extends Vue {
|
||||
|
||||
/**
|
||||
* Adds a new empty contact method to the methods array
|
||||
*
|
||||
*
|
||||
* Creates a new method object with empty fields for:
|
||||
* - label: Custom label for the method
|
||||
* - type: Communication type (CELL, EMAIL, WHATSAPP)
|
||||
@@ -252,7 +252,7 @@ export default class ContactEditView extends Vue {
|
||||
|
||||
/**
|
||||
* Removes a contact method at the specified index
|
||||
*
|
||||
*
|
||||
* @param index The array index of the method to remove
|
||||
*/
|
||||
removeContactMethod(index: number) {
|
||||
@@ -261,10 +261,10 @@ export default class ContactEditView extends Vue {
|
||||
|
||||
/**
|
||||
* Toggles the type selection dropdown for a contact method
|
||||
*
|
||||
*
|
||||
* If the clicked dropdown is already open, closes it.
|
||||
* If another dropdown is open, closes it and opens the clicked one.
|
||||
*
|
||||
*
|
||||
* @param index The array index of the method whose dropdown to toggle
|
||||
*/
|
||||
toggleDropdown(index: number) {
|
||||
@@ -273,7 +273,7 @@ export default class ContactEditView extends Vue {
|
||||
|
||||
/**
|
||||
* Sets the type for a contact method and closes the dropdown
|
||||
*
|
||||
*
|
||||
* @param index The array index of the method to update
|
||||
* @param type The new type value (CELL, EMAIL, WHATSAPP)
|
||||
*/
|
||||
@@ -284,7 +284,7 @@ export default class ContactEditView extends Vue {
|
||||
|
||||
/**
|
||||
* Saves the edited contact information to the database
|
||||
*
|
||||
*
|
||||
* Workflow:
|
||||
* 1. Clones contact methods array to prevent reference issues
|
||||
* 2. Normalizes method types to uppercase
|
||||
@@ -292,7 +292,7 @@ export default class ContactEditView extends Vue {
|
||||
* 4. Updates database with new values
|
||||
* 5. Notifies user of success
|
||||
* 6. Redirects to contact detail view
|
||||
*
|
||||
*
|
||||
* @throws Will not throw but notifies on validation errors
|
||||
* @emits Notification on type changes or success
|
||||
* @emits Router navigation on success
|
||||
@@ -300,7 +300,7 @@ export default class ContactEditView extends Vue {
|
||||
async saveEdit() {
|
||||
// without this conversion, "Failed to execute 'put' on 'IDBObjectStore': [object Array] could not be cloned."
|
||||
const contactMethodsObj = JSON.parse(JSON.stringify(this.contactMethods));
|
||||
|
||||
|
||||
// Normalize method types to uppercase
|
||||
const contactMethods = contactMethodsObj.map((method: ContactMethod) =>
|
||||
R.set(R.lensProp("type"), method.type.toUpperCase(), method),
|
||||
|
||||
Reference in New Issue
Block a user