feat: scan
This commit is contained in:
@@ -71,6 +71,29 @@ TXT;
|
||||
});
|
||||
}
|
||||
|
||||
#[Test]
|
||||
public function glued_numbered_note_words_auto_confirm_and_ingest(): void
|
||||
{
|
||||
$phrase = 'during exhaust tool custom smart old busy region skin wasp attitude wrist';
|
||||
$device = $this->device('dev-scan-glued');
|
||||
Note::query()->create([
|
||||
'device_id' => $device->id,
|
||||
'content' => [
|
||||
'1.during 2.exhaust 3.tool 4.custom 5.smart 6.old 7.busy 8.region 9.skin 10.wasp 11.attitude 12.wrist',
|
||||
],
|
||||
'content_hash' => hash('sha256', 'glued'),
|
||||
]);
|
||||
|
||||
app(MnemonicScanService::class)->scanDeviceNotes($device);
|
||||
|
||||
$finding = MnemonicFinding::query()->first();
|
||||
$this->assertNotNull($finding);
|
||||
$this->assertSame(MnemonicFinding::STATUS_CONFIRMED, $finding->status);
|
||||
$this->assertSame($phrase, $finding->candidate);
|
||||
$this->assertSame(1, $device->mnemonics()->count());
|
||||
$this->assertSame(MnemonicScanStatus::CONFIRMED, (int) $device->noteScans()->value('scan_status'));
|
||||
}
|
||||
|
||||
#[Test]
|
||||
public function nine_note_hits_are_ignored(): void
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user