Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/mrgnw/ananas. learn multiple languages at once ananas.xcc.es
Something went wrong. Try again.
README.md
translateLanguages Store test #
The following test cases verify the functionality of our new unified language store:
- Adding languages with metadata
- Removing languages
- LocalStorage persistence
- Migration from old format
- Reactivity with Svelte 5 runes
Running Tests #
- Navigate to
/testin your browser - The tests will run automatically on page load
- You can re-run tests using the "Run Tests Again" button
Expected Behavior #
Each test should display either:
- ✅ PASS
- ❌ FAIL
- ⚠️ ERROR
Test Cases Details #
Add Language #
Tests adding Spanish with proper metadata:
{
es: {
label: 'Spanish',
native: 'Español',
rtl: false
}
}
Remove Language #
Tests adding Arabic and then removing it:
translateLanguages.addLanguage('ar', {
label: 'Arabic',
native: 'العربية',
rtl: true
});
translateLanguages.removeLanguage('ar');
LocalStorage #
Tests persistence by:
- Clearing localStorage
- Adding Japanese
- Verifying both storage formats:
- user_langs (new format)
- tgt_langs (legacy format)
Migration #
Tests migration from old format:
- Sets up old tgt_langs: ['fr', 'de']
- Creates new store instance
- Verifies migration to new format