1
0
mirror of https://github.com/flarum/core.git synced 2025-08-11 02:44:04 +02:00

chore: improve group mentions parsing (#3723)

* chore: improve group mentions color handling
* Avoid storing the `GroupMention--dark` and light classes on the database.
* Avoid recreating YIQ logic on the backend.
* Improve text color flexibility through CSS variables.
* Apply fixes from StyleCI
* chore: tweak tests
* chre: unused import

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
This commit is contained in:
Sami Mazouz
2023-01-22 14:11:13 +01:00
committed by GitHub
parent da1bf8da21
commit bf52743510
5 changed files with 45 additions and 69 deletions

View File

@@ -84,7 +84,8 @@ class GroupMentionsTest extends TestCase
$response = json_decode($response->getBody(), true);
$this->assertStringContainsString('<p>One of the <span style="background:#80349E" class="GroupMention ">@Mods<i class="icon fas fa-bolt"></i></span> will look at this</p>', $response['data']['attributes']['contentHtml']);
$this->assertStringContainsString('GroupMention', $response['data']['attributes']['contentHtml']);
$this->assertStringContainsString('#80349E', $response['data']['attributes']['contentHtml']);
$this->assertNotNull(CommentPost::find($response['data']['id'])->mentionsGroups->find(4));
}