[FIX] The TS in data_setup and add expect in room and ignoreuser spec (#4658)
This commit is contained in:
parent
a5e538c13f
commit
640d83c9df
|
@ -13,6 +13,7 @@ export type TData = typeof data;
|
||||||
export type TDataKeys = keyof TData;
|
export type TDataKeys = keyof TData;
|
||||||
export type TDataUsers = keyof typeof data.users;
|
export type TDataUsers = keyof typeof data.users;
|
||||||
export type TDataChannels = keyof typeof data.channels;
|
export type TDataChannels = keyof typeof data.channels;
|
||||||
|
export type TUserRegularChannels = keyof typeof data.userRegularChannels;
|
||||||
export type TDataGroups = keyof typeof data.groups;
|
export type TDataGroups = keyof typeof data.groups;
|
||||||
export type TDataTeams = keyof typeof data.teams;
|
export type TDataTeams = keyof typeof data.teams;
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ export type TData = typeof data;
|
||||||
export type TDataKeys = keyof TData;
|
export type TDataKeys = keyof TData;
|
||||||
export type TDataUsers = keyof typeof data.users;
|
export type TDataUsers = keyof typeof data.users;
|
||||||
export type TDataChannels = keyof typeof data.channels;
|
export type TDataChannels = keyof typeof data.channels;
|
||||||
|
export type TUserRegularChannels = keyof typeof data.userRegularChannels;
|
||||||
export type TDataGroups = keyof typeof data.groups;
|
export type TDataGroups = keyof typeof data.groups;
|
||||||
export type TDataTeams = keyof typeof data.teams;
|
export type TDataTeams = keyof typeof data.teams;
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ export type TData = typeof data;
|
||||||
export type TDataKeys = keyof TData;
|
export type TDataKeys = keyof TData;
|
||||||
export type TDataUsers = keyof typeof data.users;
|
export type TDataUsers = keyof typeof data.users;
|
||||||
export type TDataChannels = keyof typeof data.channels;
|
export type TDataChannels = keyof typeof data.channels;
|
||||||
|
export type TUserRegularChannels = keyof typeof data.userRegularChannels;
|
||||||
export type TDataGroups = keyof typeof data.groups;
|
export type TDataGroups = keyof typeof data.groups;
|
||||||
export type TDataTeams = keyof typeof data.teams;
|
export type TDataTeams = keyof typeof data.teams;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import axios from 'axios';
|
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';
|
import random from './random';
|
||||||
|
|
||||||
const TEAM_TYPE = {
|
const TEAM_TYPE = {
|
||||||
|
@ -160,16 +160,8 @@ const setup = async () => {
|
||||||
|
|
||||||
for (const channelKey in data.userRegularChannels) {
|
for (const channelKey in data.userRegularChannels) {
|
||||||
if (Object.prototype.hasOwnProperty.call(data.userRegularChannels, channelKey)) {
|
if (Object.prototype.hasOwnProperty.call(data.userRegularChannels, channelKey)) {
|
||||||
const channel = data.userRegularChannels[channelKey as TDataChannels];
|
const channel = data.userRegularChannels[channelKey as TUserRegularChannels];
|
||||||
const {
|
await createChannelIfNotExists(channel.name);
|
||||||
data: {
|
|
||||||
channel: { _id }
|
|
||||||
}
|
|
||||||
} = await createChannelIfNotExists(channel.name);
|
|
||||||
|
|
||||||
if ('joinCode' in channel) {
|
|
||||||
await changeChannelJoinCode(_id, channel.joinCode);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,9 @@ describe('Room screen', () => {
|
||||||
await waitFor(element(by.id('messagebox-keyboard-emoji')))
|
await waitFor(element(by.id('messagebox-keyboard-emoji')))
|
||||||
.toExist()
|
.toExist()
|
||||||
.withTimeout(10000);
|
.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 element(by.id('emoji-picker-tab-emoji')).tap();
|
||||||
await expect(element(by.id('emoji-blush'))).toExist();
|
await expect(element(by.id('emoji-blush'))).toExist();
|
||||||
await element(by.id('emoji-blush')).tap();
|
await element(by.id('emoji-blush')).tap();
|
||||||
|
|
|
@ -41,7 +41,9 @@ describe('Ignore/Block User', () => {
|
||||||
await navigateToInfoView();
|
await navigateToInfoView();
|
||||||
});
|
});
|
||||||
it('should block user', async () => {
|
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 element(by.id('room-info-view-ignore')).tap();
|
||||||
await waitFor(element(by.id('room-info-view-ignore').withDescendant(by[textMatcher]('Unblock user'))))
|
await waitFor(element(by.id('room-info-view-ignore').withDescendant(by[textMatcher]('Unblock user'))))
|
||||||
.toExist()
|
.toExist()
|
||||||
|
|
Loading…
Reference in New Issue