Test/returning user integration test#89
Conversation
|
|
||
| global.crypto = crypto; | ||
|
|
||
| describe.skip('owner creates community', () => { |
| maxTime: number = 600000, | ||
| store: Store | ||
| ) { | ||
| log(`User ${userName} starts waiting ${maxTime}ms for channels`); |
There was a problem hiding this comment.
How many channels do we test with? It might be good to test a realistic number like 20 or 50.
There was a problem hiding this comment.
Just one channel
| export const assertReceivedRegistrationError = async (store: Store) => { | ||
| await sleep(20_000); | ||
| const errors = store.getState().Errors; | ||
| // TODO: Finish after errors slice will be fixed |
There was a problem hiding this comment.
I forgot about this, Emilia already told me about this and I fixed that - there is no error, it was me forgot add await before one function and I was thinking that this is not working
| }); | ||
|
|
||
| test('Owner creates community', async () => { | ||
| await createCommunity({ userName: 'Owner', store: owner.store }); |
There was a problem hiding this comment.
This is really nitpicky but shouldn't a username with capital letters not validate?
There was a problem hiding this comment.
I think validation happens on frontend, I''ll change this
| const ownerData = getCommunityOwnerData(owner.store); | ||
|
|
||
| await joinCommunity({ | ||
| ...ownerData, |
There was a problem hiding this comment.
Just curious but why do we pass all owner data instead of just passing the invitation link? Wouldn't it be more realistic to only give a link?
There was a problem hiding this comment.
It should be renamed to just data, it contains expectedPeersCount, registrarAddress, optional registrar port, desired username, and also some owner data, because we check if we get the correct owner CA. We check all those things in joinCommunity, this joinCommunity is a wrapper around original joinCommunity and contains the whole process of Joining community, createing certificate etc, and has a lot of assertions inside itself.
|
|
||
| test('user finishes registration', async () => { | ||
| console.log('user registered certificate'); | ||
| await assertReceivedCertificate(user.store); |
There was a problem hiding this comment.
I love how readable these are!
| }); | ||
|
|
||
| test('Owner creates community', async () => { | ||
| store = owner.store; |
There was a problem hiding this comment.
Why is this equivalent to creating a community? I would think there'd be some function here like create community.
There was a problem hiding this comment.
Oops, that's leftover, shouldn't be there, in this test case, user starts and closes app without doing anything, so no community creation here. I thought that it's okay to test this also.
| }); | ||
| }); | ||
|
|
||
| describe.skip('create community and restart app', () => { |
|
|
||
| global.crypto = crypto; | ||
|
|
||
| describe.skip('send message - users go offline and online', () => { |
No description provided.