This commit is contained in:
@ -41,6 +41,36 @@ final class ClientsLifecycleTest extends QdbTestCase
|
||||
$this->assertSame($code, $res['data']['clientCode']);
|
||||
}
|
||||
|
||||
public function testClientListIncludesFollowupNote(): void
|
||||
{
|
||||
$token = $this->api()->loginWebAndGetToken(
|
||||
DatabaseSeeder::ADMIN_USERNAME,
|
||||
DatabaseSeeder::PASSWORD
|
||||
)['token'];
|
||||
$code = $this->fixture()->clientCode;
|
||||
$note = 'Clients list note check';
|
||||
|
||||
$save = $this->api()->withToken($token, 'PUT', 'analytics', [
|
||||
'clientCode' => $code,
|
||||
'note' => $note,
|
||||
]);
|
||||
$this->assertApiOk($save);
|
||||
|
||||
$list = $this->api()->withToken($token, 'GET', 'clients', null, [
|
||||
'archiveFilter' => 'all',
|
||||
]);
|
||||
$this->assertApiOk($list);
|
||||
$match = null;
|
||||
foreach ($list['data']['clients'] ?? [] as $row) {
|
||||
if (($row['clientCode'] ?? '') === $code) {
|
||||
$match = $row;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$this->assertNotNull($match);
|
||||
$this->assertSame($note, $match['note'] ?? null);
|
||||
}
|
||||
|
||||
public function testArchiveHidesClientFromListsAndFollowUp(): void
|
||||
{
|
||||
$this->submitFixtureQuestionnaire();
|
||||
|
||||
Reference in New Issue
Block a user