[FIX] The TS in data_setup and add expect in room and ignoreuser spec (#4658)

This commit is contained in:
Reinaldo Neto 2022-11-09 13:41:39 -03:00 committed by Diego Mello
parent e54846e3e0
commit e6e5b05c3b
6 changed files with 12 additions and 13 deletions

View File

@ -13,6 +13,7 @@ export type TData = typeof data;
export type TDataKeys = keyof TData;
export type TDataUsers = keyof typeof data.users;
export type TDataChannels = keyof typeof data.channels;
export type TUserRegularChannels = keyof typeof data.userRegularChannels;
export type TDataGroups = keyof typeof data.groups;
export type TDataTeams = keyof typeof data.teams;

View File

@ -14,6 +14,7 @@ export type TData = typeof data;
export type TDataKeys = keyof TData;
export type TDataUsers = keyof typeof data.users;
export type TDataChannels = keyof typeof data.channels;
export type TUserRegularChannels = keyof typeof data.userRegularChannels;
export type TDataGroups = keyof typeof data.groups;
export type TDataTeams = keyof typeof data.teams;

View File

@ -12,6 +12,7 @@ export type TData = typeof data;
export type TDataKeys = keyof TData;
export type TDataUsers = keyof typeof data.users;
export type TDataChannels = keyof typeof data.channels;
export type TUserRegularChannels = keyof typeof data.userRegularChannels;
export type TDataGroups = keyof typeof data.groups;
export type TDataTeams = keyof typeof data.teams;

View File

@ -1,6 +1,6 @@
import axios from 'axios';
import data, { TDataChannels, TDataGroups, TDataTeams, TDataUsers } from '../data';
import data, { TDataChannels, TDataGroups, TDataTeams, TDataUsers, TUserRegularChannels } from '../data';
import random from './random';
const TEAM_TYPE = {
@ -160,16 +160,8 @@ const setup = async () => {
for (const channelKey in data.userRegularChannels) {
if (Object.prototype.hasOwnProperty.call(data.userRegularChannels, channelKey)) {
const channel = data.userRegularChannels[channelKey as TDataChannels];
const {
data: {
channel: { _id }
}
} = await createChannelIfNotExists(channel.name);
if ('joinCode' in channel) {
await changeChannelJoinCode(_id, channel.joinCode);
}
const channel = data.userRegularChannels[channelKey as TUserRegularChannels];
await createChannelIfNotExists(channel.name);
}
}

View File

@ -92,7 +92,9 @@ describe('Room screen', () => {
await waitFor(element(by.id('messagebox-keyboard-emoji')))
.toExist()
.withTimeout(10000);
await expect(element(by.id('emoji-picker-tab-emoji'))).toExist();
await waitFor(element(by.id('emoji-picker-tab-emoji')))
.toExist()
.withTimeout(10000);
await element(by.id('emoji-picker-tab-emoji')).tap();
await expect(element(by.id('emoji-blush'))).toExist();
await element(by.id('emoji-blush')).tap();

View File

@ -41,7 +41,9 @@ describe('Ignore/Block User', () => {
await navigateToInfoView();
});
it('should block user', async () => {
await expect(element(by.id('room-info-view-ignore').withDescendant(by[textMatcher]('Block user')))).toExist();
await waitFor(element(by.id('room-info-view-ignore').withDescendant(by[textMatcher]('Block user'))))
.toBeVisible()
.withTimeout(2000);
await element(by.id('room-info-view-ignore')).tap();
await waitFor(element(by.id('room-info-view-ignore').withDescendant(by[textMatcher]('Unblock user'))))
.toExist()