Skip to content
This repository was archived by the owner on Jan 7, 2022. It is now read-only.

Test/returning user integration test#89

Open
vinkabuki wants to merge 9 commits into
developfrom
test/returning-user-integration-test
Open

Test/returning user integration test#89
vinkabuki wants to merge 9 commits into
developfrom
test/returning-user-integration-test

Conversation

@vinkabuki

Copy link
Copy Markdown
Collaborator

No description provided.


global.crypto = crypto;

describe.skip('owner creates community', () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be skipped?

maxTime: number = 600000,
store: Store
) {
log(`User ${userName} starts waiting ${maxTime}ms for channels`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How many channels do we test with? It might be good to test a realistic number like 20 or 50.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one channel

Comment thread src/integrationTests/assertions.ts Outdated
export const assertReceivedRegistrationError = async (store: Store) => {
await sleep(20_000);
const errors = store.getState().Errors;
// TODO: Finish after errors slice will be fixed

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really nitpicky but shouldn't a username with capital letters not validate?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think validation happens on frontend, I''ll change this

const ownerData = getCommunityOwnerData(owner.store);

await joinCommunity({
...ownerData,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love how readable these are!

});

test('Owner creates community', async () => {
store = owner.store;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this equivalent to creating a community? I would think there'd be some function here like create community.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/integrationTests/restartApp.test.ts Outdated
});
});

describe.skip('create community and restart app', () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this skipped?


global.crypto = crypto;

describe.skip('send message - users go offline and online', () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why skip?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants