Improve chat roster parsing, message read state and loading feedback
This commit is contained in:
1 parent
c980ba10de
commit
c8941dc199
16 files changed
+183
-20
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import {Chat} from './chat.mjs';
|
||||
|
||||
test('wrapped node lists stay out of chat, including seven character aliases and single trailing nodes',()=>{
|
||||
const chat=new Chat(async()=>({}));
|
||||
try{
|
||||
for(let i=0;i<3;i++){
|
||||
chat.line('90 Node(s)');chat.line('Here ALBCHT <- DM4CHT CHTMI');
|
||||
chat.line('TSVCHAT KTCHAT NPRCHT CAMCHT TVLCHT UTHCHT KYCHAT JTQSO OCGCHT GYBCHT');
|
||||
chat.line('Nodes via DM4CHT(5) - DM4CHT CHTMI');
|
||||
chat.line('TSVCHAT');
|
||||
chat.line('IW2OHX : T');
|
||||
chat.line('Links Defined:');chat.line('DM4RW-4 Open RTT 1');chat.line('IW2OHX-5 Idle');
|
||||
}
|
||||
assert.deepEqual(chat.events.map(e=>[e.type,e.sender,e.text]),Array.from({length:3},()=>['message','IW2OHX','T']));
|
||||
assert.equal(chat.links.length,2);
|
||||
chat.line('IW2OHX : TSVCHAT KTCHAT NPRCHT');
|
||||
assert.equal(chat.events.at(-1).text,'TSVCHAT KTCHAT NPRCHT');
|
||||
}finally{clearInterval(chat.timer);}
|
||||
});
|
||||
Reference in new issue
Block a user