Skip to content

Commit

Permalink
Revert "feat(etalons && repaint): Update etalon && Add repaint to the…
Browse files Browse the repository at this point in the history
… before hook"

This reverts commit 51d4f74.
  • Loading branch information
marker dao ® committed Dec 11, 2024
1 parent 51d4f74 commit b35b321
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 80 deletions.
5 changes: 1 addition & 4 deletions e2e/testcafe-devextreme/tests/chat/alertList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,13 @@ test.clientScripts([
text: 'Message text 5',
}];

await createWidget('dxChat', {
return createWidget('dxChat', {
items,
user: userFirst,
width: 400,
height: 600,
alerts: [{ id: 1, message: 'Error Message 1. Error Description...' }],
});

const chat = new Chat('#container');
await chat.repaint();
}).after(async () => {
await ClientFunction(() => {
(window as any).MockDate.reset();
Expand Down
10 changes: 2 additions & 8 deletions e2e/testcafe-devextreme/tests/chat/avatar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,12 @@ test('Chat: avatar', async (t) => {

const items = generateMessages(2, userFirst, userSecond, false, false, 2);

await createWidget('dxChat', {
return createWidget('dxChat', {
width: 400,
height: 600,
user: userSecond,
items,
}, '#chat');

const chat = new Chat('#chat');
await chat.repaint();
});

test('Chat: showAvatar set to false', async (t) => {
Expand All @@ -61,14 +58,11 @@ test('Chat: showAvatar set to false', async (t) => {

const items = generateMessages(2, userFirst, userSecond, false, false, 2);

await createWidget('dxChat', {
return createWidget('dxChat', {
width: 400,
height: 600,
user: userSecond,
items,
showAvatar: false,
}, '#chat');

const chat = new Chat('#chat');
await chat.repaint();
});
Binary file not shown.
5 changes: 1 addition & 4 deletions e2e/testcafe-devextreme/tests/chat/messageBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,8 @@ test('Chat: messagebox', async (t) => {
}).before(async () => {
await appendElementTo('#container', 'div', 'chat');

await createWidget('dxChat', {
return createWidget('dxChat', {
width: 400,
height: 600,
}, '#chat');

const chat = new Chat('#chat');
await chat.repaint();
});
5 changes: 1 addition & 4 deletions e2e/testcafe-devextreme/tests/chat/messageBubble.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,8 @@ test('Chat: messagebubble', async (t) => {
}).before(async () => {
await appendElementTo('#container', 'div', 'chat');

await createWidget('dxChat', {
return createWidget('dxChat', {
width: 400,
height: 650,
}, '#chat');

const chat = new Chat('#chat');
await chat.repaint();
});
18 changes: 3 additions & 15 deletions e2e/testcafe-devextreme/tests/chat/messageGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,11 @@ test('Chat: messagegroup, avatar rendering', async (t) => {
const userFirst = createUser(1, 'First');
const items = generateMessages(3, userFirst);

await createWidget('dxChat', {
return createWidget('dxChat', {
width: 400,
height: 600,
items,
}, '#chat');

const chat = new Chat('#chat');
await chat.repaint();
});

test('Chat: messagegroup, information', async (t) => {
Expand All @@ -60,15 +57,12 @@ test('Chat: messagegroup, information', async (t) => {

const items = generateMessages(2, userFirst, userSecond, false, false, 2);

await createWidget('dxChat', {
return createWidget('dxChat', {
width: 400,
height: 600,
user: userSecond,
items,
}, '#chat');

const chat = new Chat('#chat');
await chat.repaint();
});

test('Chat: messagegroup, bubbles', async (t) => {
Expand Down Expand Up @@ -105,13 +99,10 @@ test('Chat: messagegroup, bubbles', async (t) => {
}).before(async () => {
await appendElementTo('#container', 'div', 'chat');

await createWidget('dxChat', {
return createWidget('dxChat', {
width: 400,
height: 600,
}, '#chat');

const chat = new Chat('#chat');
await chat.repaint();
});

test('Messagegroup scenarios in disabled state', async (t) => {
Expand All @@ -135,9 +126,6 @@ test('Messagegroup scenarios in disabled state', async (t) => {
width: 250,
height: 400,
}, chatId);

const chat = new Chat(chatId);
await chat.repaint();
});

await testScreenshot(t, takeScreenshot, 'Messagegroup appearance in disabled state.png', { element: '#container' });
Expand Down
43 changes: 10 additions & 33 deletions e2e/testcafe-devextreme/tests/chat/messageList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,10 @@ test('Messagelist empty view scenarios', async (t) => {
await t
.expect(compareResults.isValid())
.ok(compareResults.errorMessages());
}).before(async () => {
await createWidget('dxChat', {
width: 400,
height: 600,
});

const chat = new Chat('#container');
await chat.repaint();
});
}).before(async () => createWidget('dxChat', {
width: 400,
height: 600,
}));

test('Messagelist appearance with scrollbar', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
Expand Down Expand Up @@ -105,7 +100,7 @@ test('Messagelist appearance with scrollbar', async (t) => {

const items = generateMessages(17, userFirst, userSecond, true, false, 2);

await createWidget('dxChat', {
return createWidget('dxChat', {
items,
user: userSecond,
width: 400,
Expand All @@ -117,9 +112,6 @@ test('Messagelist appearance with scrollbar', async (t) => {
component.renderMessage(message);
},
});

const chat = new Chat('#container');
await chat.repaint();
});

test('Messagelist should scrolled to the latest messages after being rendered inside an invisible element', async (t) => {
Expand All @@ -141,7 +133,7 @@ test('Messagelist should scrolled to the latest messages after being rendered in

const items = generateMessages(17, userFirst, userSecond, true, false, 2);

await createWidget('dxTabPanel', {
return createWidget('dxTabPanel', {
width: 400,
height: 500,
deferRendering: true,
Expand All @@ -153,15 +145,12 @@ test('Messagelist should scrolled to the latest messages after being rendered in
}, {
title: 'Tab_2',
collapsible: true,
template: ClientFunction(() => ($('<div id="chat">') as any).dxChat({
template: ClientFunction(() => ($('<div>') as any).dxChat({
items,
user: userSecond,
}), { dependencies: { items, userSecond } }),
}],
});

const chat = new Chat('#chat');
await chat.repaint();
});

test('Messagelist with loadindicator appearance on initial loading', async (t) => {
Expand Down Expand Up @@ -193,9 +182,6 @@ test('Messagelist with loadindicator appearance on initial loading', async (t) =
height: 600,
};
});

const chat = new Chat('#container');
await chat.repaint();
});

test('Messagelist with messageTemplate', async (t) => {
Expand Down Expand Up @@ -227,7 +213,7 @@ test('Messagelist with messageTemplate', async (t) => {
text: 'CCC',
}];

await createWidget('dxChat', {
return createWidget('dxChat', {
items,
user: userFirst,
width: 400,
Expand All @@ -241,9 +227,6 @@ test('Messagelist with messageTemplate', async (t) => {
$('<div>').text(`${message.author.name} says: ${message.text}`).appendTo(container);
},
});

const chat = new Chat('#container');
await chat.repaint();
});

test('Messagelist options showDayHeaders, showUserName and showMessageTimestamp set to false work', async (t) => {
Expand Down Expand Up @@ -273,7 +256,7 @@ test('Messagelist options showDayHeaders, showUserName and showMessageTimestamp
text: 'CCC',
}];

await createWidget('dxChat', {
return createWidget('dxChat', {
items,
user: userFirst,
width: 400,
Expand All @@ -282,9 +265,6 @@ test('Messagelist options showDayHeaders, showUserName and showMessageTimestamp
showUserName: false,
showMessageTimestamp: false,
});

const chat = new Chat('#container');
await chat.repaint();
});

fixture`ChatMessageList: dayHeaders`
Expand Down Expand Up @@ -334,15 +314,12 @@ test.clientScripts([
text: 'EEE',
}];

await createWidget('dxChat', {
return createWidget('dxChat', {
items,
user: userSecond,
width: 400,
height: 600,
});

const chat = new Chat('#container');
await chat.repaint();
}).after(async () => {
await ClientFunction(() => {
(window as any).MockDate.reset();
Expand Down
16 changes: 4 additions & 12 deletions e2e/testcafe-devextreme/tests/chat/typingIndicator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ test('Chat: typing indicator with emptyview', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);

const chat = new Chat('#container');
await chat.repaint();

await testScreenshot(t, takeScreenshot, 'Typing indicator with emptyview.png', {
element: '#container',
Expand Down Expand Up @@ -43,14 +44,11 @@ test('Chat: typing indicator with emptyview', async (t) => {
{ name: 'Elodie Montclair' },
];

await createWidget('dxChat', {
return createWidget('dxChat', {
width: 400,
height: 600,
typingUsers,
});

const chat = new Chat('#container');
await chat.repaint();
});

test('Chat: typing indicator with a lot of items', async (t) => {
Expand All @@ -72,16 +70,13 @@ test('Chat: typing indicator with a lot of items', async (t) => {

const typingUsers = [userFirst];

await createWidget('dxChat', {
return createWidget('dxChat', {
user: userSecond,
width: 400,
height: 600,
items,
typingUsers,
}, '#chat');

const chat = new Chat('#chat');
await chat.repaint();
});

test('Chat: typing indicator', async (t) => {
Expand Down Expand Up @@ -125,14 +120,11 @@ test('Chat: typing indicator', async (t) => {

const typingUsers = [userFirst];

await createWidget('dxChat', {
return createWidget('dxChat', {
user: userSecond,
width: 400,
height: 600,
items,
typingUsers,
}, '#chat');

const chat = new Chat('#chat');
await chat.repaint();
});

0 comments on commit b35b321

Please sign in to comment.