
- Complete NestJS TypeScript implementation with WebSocket support - Direct messaging (DM) and group chat functionality - End-to-end encryption with AES encryption and key pairs - Media file support (images, videos, audio, documents) up to 100MB - Push notifications with Firebase Cloud Messaging integration - Mention alerts and real-time typing indicators - User authentication with JWT and Passport - SQLite database with TypeORM entities and relationships - Comprehensive API documentation with Swagger/OpenAPI - File upload handling with secure access control - Online/offline status tracking and presence management - Message editing, deletion, and reply functionality - Notification management with automatic cleanup - Health check endpoint for monitoring - CORS configuration for cross-origin requests - Environment-based configuration management - Structured for Flutter SDK integration Features implemented: ✅ Real-time messaging with Socket.IO ✅ User registration and authentication ✅ Direct messages and group chats ✅ Media file uploads and management ✅ End-to-end encryption ✅ Push notifications ✅ Mention alerts ✅ Typing indicators ✅ Message read receipts ✅ Online status tracking ✅ File access control ✅ Comprehensive API documentation Ready for Flutter SDK development and production deployment.
35 lines
1.7 KiB
JavaScript
35 lines
1.7 KiB
JavaScript
/*
|
|
import { containsMoreThanOneSlashInNationalNumber } from './Leniency.js'
|
|
|
|
describe('Leniency', () => {
|
|
it('testContainsMoreThanOneSlashInNationalNumber', () => {
|
|
// A date should return true.
|
|
number.setCountryCode(1)
|
|
number.setCountryCodeSource(CountryCodeSource.FROM_DEFAULT_COUNTRY)
|
|
containsMoreThanOneSlashInNationalNumber(number, '1/05/2013').should.equal(true)
|
|
|
|
// Here, the country code source thinks it started with a country calling code, but this is not
|
|
// the same as the part before the slash, so it's still true.
|
|
number.setCountryCode(274)
|
|
number.setCountryCodeSource(CountryCodeSource.FROM_NUMBER_WITHOUT_PLUS_SIGN)
|
|
containsMoreThanOneSlashInNationalNumber(number, '27/4/2013').should.equal(true)
|
|
|
|
// Now it should be false, because the first slash is after the country calling code.
|
|
number.setCountryCode(49)
|
|
number.setCountryCodeSource(CountryCodeSource.FROM_NUMBER_WITH_PLUS_SIGN)
|
|
containsMoreThanOneSlashInNationalNumber(number, '49/69/2013').should.equal(false)
|
|
|
|
number.setCountryCode(49)
|
|
number.setCountryCodeSource(CountryCodeSource.FROM_NUMBER_WITHOUT_PLUS_SIGN)
|
|
containsMoreThanOneSlashInNationalNumber(number, '+49/69/2013').should.equal(false)
|
|
containsMoreThanOneSlashInNationalNumber(number, '+ 49/69/2013').should.equal(false)
|
|
containsMoreThanOneSlashInNationalNumber(number, '+ 49/69/20/13').should.equal(true)
|
|
|
|
// Here, the first group is not assumed to be the country calling code, even though it is the
|
|
// same as it, so this should return true.
|
|
number.setCountryCode(49)
|
|
number.setCountryCodeSource(CountryCodeSource.FROM_DEFAULT_COUNTRY)
|
|
containsMoreThanOneSlashInNationalNumber(number, '49/69/2013').should.equal(true)
|
|
})
|
|
})
|
|
*/ |