mirror of
https://github.com/coollabsio/coolify.git
synced 2026-10-06 05:58:14 -04:00
- Add live 24h polling toggle to server/application analytics views - Add geo visualization (world map, country flags/names) for traffic - Add dashboard nudge for servers eligible but not yet analytics-enabled - Add lazy-loaded TrafficOverview widget to application General page - Default-enable traffic analytics on new eligible server settings - Rotate Caddy access logs via lumberjack roll options - Add Traefik logrotate sidecar for copytruncate access-log rotation
43 lines
1.2 KiB
PHP
43 lines
1.2 KiB
PHP
<?php
|
|
|
|
describe('countryFlagEmoji', function () {
|
|
it('returns the correct flag for a valid uppercase code', function () {
|
|
expect(countryFlagEmoji('US'))->toBe('🇺🇸');
|
|
});
|
|
|
|
it('is case-insensitive', function () {
|
|
expect(countryFlagEmoji('us'))->toBe('🇺🇸');
|
|
});
|
|
|
|
it('returns the globe fallback for invalid input', function (?string $input) {
|
|
expect(countryFlagEmoji($input))->toBe('🌐');
|
|
})->with([
|
|
'null' => [null],
|
|
'empty' => [''],
|
|
'three letters' => ['USA'],
|
|
'non-letters' => ['1!'],
|
|
'single letter' => ['U'],
|
|
]);
|
|
});
|
|
|
|
describe('countryName', function () {
|
|
it('returns the English region name for a valid uppercase code', function () {
|
|
expect(countryName('US'))->toBe('United States');
|
|
});
|
|
|
|
it('is case-insensitive', function () {
|
|
expect(countryName('us'))->toBe('United States');
|
|
});
|
|
|
|
it('returns Unknown for invalid input', function (?string $input) {
|
|
expect(countryName($input))->toBe('Unknown');
|
|
})->with([
|
|
'null' => [null],
|
|
'empty' => [''],
|
|
'unresolvable ZZ' => ['ZZ'],
|
|
'unresolvable XX' => ['XX'],
|
|
'three letters' => ['USA'],
|
|
'non-letters' => ['1!'],
|
|
]);
|
|
});
|