mirror of
https://github.com/urbit/shrub.git
synced 2025-01-06 04:07:23 +03:00
interface: add new test for mention+link msgs
This commit is contained in:
parent
14e7378486
commit
e704d90e06
@ -65,4 +65,12 @@ describe('tokenizeMessage', () => {
|
|||||||
expect(url).toEqual('https://urbit.org');
|
expect(url).toEqual('https://urbit.org');
|
||||||
expect(text3).toEqual(' a link is here!');
|
expect(text3).toEqual(' a link is here!');
|
||||||
});
|
});
|
||||||
|
it('should tokenize both mentions and links', () => {
|
||||||
|
const example = '~haddef-sigwen have you looked at https://urbit.org lately?';
|
||||||
|
const [{ mention }, { text }, { url }, { text: text2 }] = tokenizeMessage(example);
|
||||||
|
expect(mention).toEqual('~haddef-sigwen');
|
||||||
|
expect(text).toEqual(' have you looked at ');
|
||||||
|
expect(url).toEqual('https://urbit.org');
|
||||||
|
expect(text2).toEqual(' lately?');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user