@@ -11,77 +11,77 @@ import { appendElementTo } from '../../../helpers/domUtils';
1111fixture . disablePageReloads `ChatMessageBox`
1212 . page ( url ( __dirname , '../../container.html' ) ) ;
1313
14- // test('Chat: messagebox', async (t) => {
15- // const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
16-
17- // const chat = new Chat('#chat');
18-
19- // const shortText = getShortText();
20- // const longText = getLongText(false, 5);
21-
22- // await chat.focus();
23- // await testScreenshot(t, takeScreenshot, 'Messagebox when chat has focus.png', { element: '#chat' });
24-
25- // await t.typeText(chat.getInput(), shortText);
26- // await testScreenshot(t, takeScreenshot, 'Messagebox when input contains short text.png', { element: '#chat' });
27-
28- // await t.typeText(chat.getInput(), longText);
29- // await testScreenshot(t, takeScreenshot, 'Messagebox when input contains long text.png', { element: '#chat' });
30-
31- // await t.pressKey('tab');
32- // await testScreenshot(t, takeScreenshot, 'Messagebox when send button has focus.png', { element: '#chat' });
33-
34- // await t
35- // .expect(compareResults.isValid())
36- // .ok(compareResults.errorMessages());
37- // }).before(async () => {
38- // await appendElementTo('#container', 'div', 'chat');
39-
40- // return createWidget('dxChat', {
41- // width: 400,
42- // height: 600,
43- // }, '#chat');
44- // });
45-
46- // test('Chat: messagebox with editing preview', async (t) => {
47- // const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
48-
49- // const chat = new Chat('#chat');
50-
51- // await t.rightClick(chat.getMessage(0));
52- // await t.click(chat.getContextMenuItem(0));
53-
54- // await testScreenshot(t, takeScreenshot, 'Messagebox with editing preview.png', {
55- // element: '#chat',
56- // });
57-
58- // await t
59- // .expect(compareResults.isValid())
60- // .ok(compareResults.errorMessages());
61- // }).before(async () => {
62- // await appendElementTo('#container', 'div', 'chat');
63-
64- // const userFirst = createUser(1, 'First');
65- // const userSecond = createUser(2, 'Second');
66-
67- // const items = [{
68- // author: userFirst,
69- // text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
70- // }, {
71- // author: userSecond,
72- // text: 'Short message',
73- // }];
74-
75- // return createWidget('dxChat', {
76- // items,
77- // user: userFirst,
78- // editing: {
79- // allowUpdating: true,
80- // },
81- // width: 400,
82- // height: 600,
83- // }, '#chat');
84- // });
14+ test ( 'Chat: messagebox' , async ( t ) => {
15+ const { takeScreenshot, compareResults } = createScreenshotsComparer ( t ) ;
16+
17+ const chat = new Chat ( '#chat' ) ;
18+
19+ const shortText = getShortText ( ) ;
20+ const longText = getLongText ( false , 5 ) ;
21+
22+ await chat . focus ( ) ;
23+ await testScreenshot ( t , takeScreenshot , 'Messagebox when chat has focus.png' , { element : '#chat' } ) ;
24+
25+ await t . typeText ( chat . getInput ( ) , shortText ) ;
26+ await testScreenshot ( t , takeScreenshot , 'Messagebox when input contains short text.png' , { element : '#chat' } ) ;
27+
28+ await t . typeText ( chat . getInput ( ) , longText ) ;
29+ await testScreenshot ( t , takeScreenshot , 'Messagebox when input contains long text.png' , { element : '#chat' } ) ;
30+
31+ await t . pressKey ( 'tab' ) ;
32+ await testScreenshot ( t , takeScreenshot , 'Messagebox when send button has focus.png' , { element : '#chat' } ) ;
33+
34+ await t
35+ . expect ( compareResults . isValid ( ) )
36+ . ok ( compareResults . errorMessages ( ) ) ;
37+ } ) . before ( async ( ) => {
38+ await appendElementTo ( '#container' , 'div' , 'chat' ) ;
39+
40+ return createWidget ( 'dxChat' , {
41+ width : 400 ,
42+ height : 600 ,
43+ } , '#chat' ) ;
44+ } ) ;
45+
46+ test ( 'Chat: messagebox with editing preview' , async ( t ) => {
47+ const { takeScreenshot, compareResults } = createScreenshotsComparer ( t ) ;
48+
49+ const chat = new Chat ( '#chat' ) ;
50+
51+ await t . rightClick ( chat . getMessage ( 0 ) ) ;
52+ await t . click ( chat . getContextMenuItem ( 0 ) ) ;
53+
54+ await testScreenshot ( t , takeScreenshot , 'Messagebox with editing preview.png' , {
55+ element : '#chat' ,
56+ } ) ;
57+
58+ await t
59+ . expect ( compareResults . isValid ( ) )
60+ . ok ( compareResults . errorMessages ( ) ) ;
61+ } ) . before ( async ( ) => {
62+ await appendElementTo ( '#container' , 'div' , 'chat' ) ;
63+
64+ const userFirst = createUser ( 1 , 'First' ) ;
65+ const userSecond = createUser ( 2 , 'Second' ) ;
66+
67+ const items = [ {
68+ author : userFirst ,
69+ text : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.' ,
70+ } , {
71+ author : userSecond ,
72+ text : 'Short message' ,
73+ } ] ;
74+
75+ return createWidget ( 'dxChat' , {
76+ items,
77+ user : userFirst ,
78+ editing : {
79+ allowUpdating : true ,
80+ } ,
81+ width : 400 ,
82+ height : 600 ,
83+ } , '#chat' ) ;
84+ } ) ;
8585
8686test ( 'Chat: messagebox with attachments and informer' , async ( t ) => {
8787 const { takeScreenshot, compareResults } = createScreenshotsComparer ( t ) ;
@@ -100,7 +100,6 @@ test('Chat: messagebox with attachments and informer', async (t) => {
100100 } ) ;
101101
102102 await chat . focus ( ) ;
103- await t . debug ( ) ;
104103 await testScreenshot ( t , takeScreenshot , 'Messagebox with attachments and informer.png' , { element : '#chat' } ) ;
105104
106105 await t
0 commit comments