Record .key().set() Test (#56)
Testing if .key(k).set(v) fails on empty Records or with hyphenated
keys
{/* Current state display */}
Current State:
emptyRecord: {JSON.stringify(emptyRecord)}
populatedRecord: {JSON.stringify(populatedRecord)}
{/* Test buttons */}
Tests on Empty Record
A: Simple key on empty
B: Hyphen key on empty (the problematic case)
Tests on Populated Record
C: Update existing key
D: New hyphen key on populated
Workaround
E: Spread workaround on empty
{/* Logs */}
Test Results
Clear
{logs.map((log) => (
{log}
))}
{/* Expected results */}
Superstition claims:
- A & B should FAIL (empty record)
- B especially should FAIL (hyphenated key)
- C should PASS (update existing)
- D might PASS (populated record)
- E should always PASS (workaround)
),
emptyRecord,
populatedRecord,
logs,
};
});