From 900891a202ba41c0b67b0e3b53f19594f8bd5f30 Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Fri, 22 Jul 2022 11:14:45 +0200 Subject: [PATCH 01/32] baseUrl change --- integration/cypress.config.ts | 3 ++- integration/ui/connect_chatplugin.spec.ts | 12 ------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/integration/cypress.config.ts b/integration/cypress.config.ts index bf45b999ad..2f5c72e41b 100644 --- a/integration/cypress.config.ts +++ b/integration/cypress.config.ts @@ -2,11 +2,12 @@ import {defineConfig} from 'cypress'; export default defineConfig({ e2e: { - baseUrl: 'http://airy.core', + baseUrl: 'http://localhost', specPattern: 'integration/**/*.spec.?s', supportFile: 'integration/commands/index.ts', }, env: { + requestBaseUrl: 'http://airy.core', chatPluginName: 'Cypress Chatplugin', tagName: 'Cypress Tag', searchQuery: 'Cypress Filter', diff --git a/integration/ui/connect_chatplugin.spec.ts b/integration/ui/connect_chatplugin.spec.ts index 9b92b575cb..7473ab1a0d 100644 --- a/integration/ui/connect_chatplugin.spec.ts +++ b/integration/ui/connect_chatplugin.spec.ts @@ -1,17 +1,5 @@ import {cyChannelsFormBackButton, cyChannelsChatPluginList} from 'handles'; -declare global { - namespace Cypress { - interface Chainable { - createChatPluginConversation(): Chainable; - editContactDetails(): Chainable; - connectChatPluginConnector(): Chainable; - editDisplayName(): Chainable; - listConversationsForContact(): Chainable; - } - } -} - describe('Connect chatplugin channel', () => { it('Connect chatplugin channel', () => { cy.visit('/control-center/connectors'); From 231c2d151ca98f46537011a0623aa7644dbf0362 Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Tue, 26 Jul 2022 09:38:42 +0200 Subject: [PATCH 02/32] baseUrl change --- frontend/control-center/src/pages/Connectors/index.tsx | 2 +- integration/chat-plugin/websocket_test.spec.ts | 4 ++-- integration/cypress.config.ts | 2 +- integration/ui/connect_chatplugin.spec.ts | 2 +- integration/ui/filter_conversation.spec.ts | 7 ------- integration/ui/suggested_replies.spec.ts | 3 ++- 6 files changed, 7 insertions(+), 13 deletions(-) diff --git a/frontend/control-center/src/pages/Connectors/index.tsx b/frontend/control-center/src/pages/Connectors/index.tsx index 2cde61e97a..2d16ae1e49 100644 --- a/frontend/control-center/src/pages/Connectors/index.tsx +++ b/frontend/control-center/src/pages/Connectors/index.tsx @@ -127,7 +127,7 @@ const Connectors = (props: ConnectedProps) => { }} /> - )) + )) ); })} diff --git a/integration/chat-plugin/websocket_test.spec.ts b/integration/chat-plugin/websocket_test.spec.ts index 1e2fbbb344..f074e81d40 100644 --- a/integration/chat-plugin/websocket_test.spec.ts +++ b/integration/chat-plugin/websocket_test.spec.ts @@ -29,7 +29,7 @@ describe('Websocket test', () => { cy.request({ method: 'POST', - url: '/conversations.list', + url: Cypress.env('baseRequestUrl') + '/conversations.list', headers: { 'Content-Type': 'application/json', }, @@ -42,7 +42,7 @@ describe('Websocket test', () => { cy.request({ method: 'POST', - url: '/messages.send', + url: Cypress.env('baseRequestUrl') + '/messages.send', headers: { 'Content-Type': 'application/json', }, diff --git a/integration/cypress.config.ts b/integration/cypress.config.ts index 2f5c72e41b..98bddac77e 100644 --- a/integration/cypress.config.ts +++ b/integration/cypress.config.ts @@ -2,7 +2,7 @@ import {defineConfig} from 'cypress'; export default defineConfig({ e2e: { - baseUrl: 'http://localhost', + baseUrl: 'http://airy.core', specPattern: 'integration/**/*.spec.?s', supportFile: 'integration/commands/index.ts', }, diff --git a/integration/ui/connect_chatplugin.spec.ts b/integration/ui/connect_chatplugin.spec.ts index 7473ab1a0d..2fba9cfecc 100644 --- a/integration/ui/connect_chatplugin.spec.ts +++ b/integration/ui/connect_chatplugin.spec.ts @@ -3,7 +3,7 @@ import {cyChannelsFormBackButton, cyChannelsChatPluginList} from 'handles'; describe('Connect chatplugin channel', () => { it('Connect chatplugin channel', () => { cy.visit('/control-center/connectors'); - cy.wait(500); + cy.wait(8000); cy.url().should('include', '/control-center/connectors'); cy.connectChatPluginConnector(); diff --git a/integration/ui/filter_conversation.spec.ts b/integration/ui/filter_conversation.spec.ts index ee0cf371f3..7d7be66b5f 100644 --- a/integration/ui/filter_conversation.spec.ts +++ b/integration/ui/filter_conversation.spec.ts @@ -2,15 +2,8 @@ import { cySearchButton, cySearchField, cyConversationList, - cyChannelsChatPluginAddButton, - cyChannelsChatPluginFormNameInput, - cyChannelsChatPluginFormSubmitButton, - cyChannelsFormBackButton, - cyConnectorsAddNewButton, } from 'handles'; -import {cyInputbarButton, cyInputbarTextarea} from 'chat-plugin-handles'; - describe('Filter conversation', () => { it('Filter conversation', () => { cy.visit('/control-center/connectors'); diff --git a/integration/ui/suggested_replies.spec.ts b/integration/ui/suggested_replies.spec.ts index 3e13e1cbcc..476088b61f 100644 --- a/integration/ui/suggested_replies.spec.ts +++ b/integration/ui/suggested_replies.spec.ts @@ -1,10 +1,11 @@ import {cySuggestionsButton, cySuggestionsList, cyMessageSendButton, cyMessageList} from 'handles'; +import { env } from 'process'; describe('adds two suggested replies to a message and sends one of the suggested replies to a chatplugin conversation', () => { it('adds two suggested replies to a message and sends one suggested reply', () => { cy.request({ method: 'POST', - url: '/messages.suggestReplies', + url: Cypress.env('baseRequestUrl') + '/messages.suggestReplies', headers: { 'Content-Type': 'application/json', }, From 0d64ab1417975b59350b5906d9d6b0b4897aef7e Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Fri, 29 Jul 2022 14:50:36 +0200 Subject: [PATCH 03/32] rebase wip --- integration/cypress.config.ts | 3 +-- integration/ui/connect_chatplugin.spec.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/integration/cypress.config.ts b/integration/cypress.config.ts index 98bddac77e..bb6a59bf72 100644 --- a/integration/cypress.config.ts +++ b/integration/cypress.config.ts @@ -2,12 +2,11 @@ import {defineConfig} from 'cypress'; export default defineConfig({ e2e: { - baseUrl: 'http://airy.core', + baseUrl: 'http://localhost', specPattern: 'integration/**/*.spec.?s', supportFile: 'integration/commands/index.ts', }, env: { - requestBaseUrl: 'http://airy.core', chatPluginName: 'Cypress Chatplugin', tagName: 'Cypress Tag', searchQuery: 'Cypress Filter', diff --git a/integration/ui/connect_chatplugin.spec.ts b/integration/ui/connect_chatplugin.spec.ts index 2fba9cfecc..944fa389bb 100644 --- a/integration/ui/connect_chatplugin.spec.ts +++ b/integration/ui/connect_chatplugin.spec.ts @@ -7,7 +7,7 @@ describe('Connect chatplugin channel', () => { cy.url().should('include', '/control-center/connectors'); cy.connectChatPluginConnector(); - cy.url().should('include', '/control-center/connectors/connected'); + cy.url().should('include', '/control-center/connectors'); cy.get(`[data-cy=${cyChannelsFormBackButton}]`).click(); cy.get(`[data-cy=${cyChannelsChatPluginList}]`).filter(`:contains("${Cypress.env('chatPluginName')}")`); }); From eda4f66e830bdc792e1e88ef9d989d0be3646ce5 Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Fri, 29 Jul 2022 17:10:38 +0200 Subject: [PATCH 04/32] tests update --- .../Airy/ChatPlugin/ChatPluginConnect.tsx | 2 ++ .../src/pages/Connectors/index.tsx | 2 +- .../Status/ComponentListItem/ItemInfo.tsx | 2 +- frontend/inbox/handles/index.ts | 1 + .../chat-plugin/websocket_test.spec.ts | 21 ++----------------- .../commands/createChatPluginConversation.ts | 7 +++++-- integration/ui/create_tag.spec.ts | 20 ++---------------- integration/ui/filter_conversation.spec.ts | 6 +----- integration/ui/suggested_replies.spec.ts | 5 ++--- .../alerts/SettingsModal/ModalHeader.tsx | 5 +++-- .../components/alerts/SettingsModal/index.tsx | 17 ++++++++++++--- 11 files changed, 34 insertions(+), 54 deletions(-) diff --git a/frontend/control-center/src/pages/Connectors/Providers/Airy/ChatPlugin/ChatPluginConnect.tsx b/frontend/control-center/src/pages/Connectors/Providers/Airy/ChatPlugin/ChatPluginConnect.tsx index f624606c93..6fe0e1323a 100644 --- a/frontend/control-center/src/pages/Connectors/Providers/Airy/ChatPlugin/ChatPluginConnect.tsx +++ b/frontend/control-center/src/pages/Connectors/Providers/Airy/ChatPlugin/ChatPluginConnect.tsx @@ -6,6 +6,7 @@ import {apiHostUrl} from '../../../../../httpClient'; import {StateModel} from '../../../../../reducers'; import {allChannels} from '../../../../../selectors/channels'; import {connectChatPlugin, updateChannel, disconnectChannel} from '../../../../../actions'; +import {cyChannelCreatedChatPluginCloseButton} from 'handles'; import {Button, LinkButton, SettingsModal} from 'components'; import {Channel, Source} from 'model'; @@ -209,6 +210,7 @@ const ChatPluginConnect = (props: ConnectedProps) => { title={t('successfullyCreatedChannel')} close={handleClose} headerClassName={styles.headerModal} + dataCyCloseButton={cyChannelCreatedChatPluginCloseButton} >
diff --git a/lib/typescript/components/alerts/SettingsModal/index.tsx b/lib/typescript/components/alerts/SettingsModal/index.tsx index bc9b0faf1a..4c3799f496 100644 --- a/lib/typescript/components/alerts/SettingsModal/index.tsx +++ b/lib/typescript/components/alerts/SettingsModal/index.tsx @@ -13,10 +13,22 @@ type SettingsModalProps = { Icon?: React.ReactElement | null; headerClassName?: string; style?: CSSProperties; + dataCyCloseButton?: string; }; export const SettingsModal = (props: SettingsModalProps) => { - const {close, title, children, headerClassName, wrapperClassName, style, containerClassName, Icon} = props; + const { + close, + title, + children, + headerClassName, + wrapperClassName, + style, + containerClassName, + Icon, + dataCyCloseButton, + } = props; + console.log('SETTINGS dataCyCloseButton', dataCyCloseButton); return ( { contentLabel={title} isOpen={true} shouldCloseOnOverlayClick={true} - onRequestClose={close} - > + onRequestClose={close}>
{Icon ? Icon : ''} From f304edb20c419db97f81551a23052f0348cad9fa Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Fri, 29 Jul 2022 17:13:49 +0200 Subject: [PATCH 05/32] fix --- integration/chat-plugin/websocket_test.spec.ts | 4 ++-- lib/typescript/components/alerts/SettingsModal/index.tsx | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/integration/chat-plugin/websocket_test.spec.ts b/integration/chat-plugin/websocket_test.spec.ts index a3463c363f..ce549d9c83 100644 --- a/integration/chat-plugin/websocket_test.spec.ts +++ b/integration/chat-plugin/websocket_test.spec.ts @@ -12,7 +12,7 @@ describe('Websocket test', () => { cy.request({ method: 'POST', - url: Cypress.env('baseRequestUrl') + '/conversations.list', + url: '/conversations.list', headers: { 'Content-Type': 'application/json', }, @@ -25,7 +25,7 @@ describe('Websocket test', () => { cy.request({ method: 'POST', - url: Cypress.env('baseRequestUrl') + '/messages.send', + url: '/messages.send', headers: { 'Content-Type': 'application/json', }, diff --git a/lib/typescript/components/alerts/SettingsModal/index.tsx b/lib/typescript/components/alerts/SettingsModal/index.tsx index 4c3799f496..18abe84542 100644 --- a/lib/typescript/components/alerts/SettingsModal/index.tsx +++ b/lib/typescript/components/alerts/SettingsModal/index.tsx @@ -28,7 +28,6 @@ export const SettingsModal = (props: SettingsModalProps) => { Icon, dataCyCloseButton, } = props; - console.log('SETTINGS dataCyCloseButton', dataCyCloseButton); return ( Date: Fri, 29 Jul 2022 17:30:46 +0200 Subject: [PATCH 06/32] linting --- integration/ui/connect_chatplugin.spec.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/integration/ui/connect_chatplugin.spec.ts b/integration/ui/connect_chatplugin.spec.ts index 944fa389bb..ab7a23c2f1 100644 --- a/integration/ui/connect_chatplugin.spec.ts +++ b/integration/ui/connect_chatplugin.spec.ts @@ -1,5 +1,17 @@ import {cyChannelsFormBackButton, cyChannelsChatPluginList} from 'handles'; +declare global { + namespace Cypress { + interface Chainable { + createChatPluginConversation(): Chainable; + editContactDetails(): Chainable; + connectChatPluginConnector(): Chainable; + editDisplayName(): Chainable; + listConversationsForContact(): Chainable; + } + } +} + describe('Connect chatplugin channel', () => { it('Connect chatplugin channel', () => { cy.visit('/control-center/connectors'); From 85d6948bcf6fa534b535d11ca56bc265c10c6195 Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Tue, 2 Aug 2022 10:04:17 +0200 Subject: [PATCH 07/32] fix typing --- integration/chat-plugin/websocket_test.spec.ts | 12 ++++++++++++ integration/ui/connect_chatplugin.spec.ts | 12 ------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/integration/chat-plugin/websocket_test.spec.ts b/integration/chat-plugin/websocket_test.spec.ts index ce549d9c83..5415747cec 100644 --- a/integration/chat-plugin/websocket_test.spec.ts +++ b/integration/chat-plugin/websocket_test.spec.ts @@ -1,5 +1,17 @@ import {cyChatPluginMessageList} from 'chat-plugin-handles'; +declare global { + namespace Cypress { + interface Chainable { + createChatPluginConversation(): Chainable; + editContactDetails(): Chainable; + connectChatPluginConnector(): Chainable; + editDisplayName(): Chainable; + listConversationsForContact(): Chainable; + } + } +} + describe('Websocket test', () => { it('Send message from Inbox to Chatplugin and assert Websocket is working', () => { cy.createChatPluginConversation(); diff --git a/integration/ui/connect_chatplugin.spec.ts b/integration/ui/connect_chatplugin.spec.ts index ab7a23c2f1..944fa389bb 100644 --- a/integration/ui/connect_chatplugin.spec.ts +++ b/integration/ui/connect_chatplugin.spec.ts @@ -1,17 +1,5 @@ import {cyChannelsFormBackButton, cyChannelsChatPluginList} from 'handles'; -declare global { - namespace Cypress { - interface Chainable { - createChatPluginConversation(): Chainable; - editContactDetails(): Chainable; - connectChatPluginConnector(): Chainable; - editDisplayName(): Chainable; - listConversationsForContact(): Chainable; - } - } -} - describe('Connect chatplugin channel', () => { it('Connect chatplugin channel', () => { cy.visit('/control-center/connectors'); From 49bceb44410d94b3d5cd2b0a41bbd3bea20261fe Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Tue, 2 Aug 2022 10:48:05 +0200 Subject: [PATCH 08/32] fixed typings tests --- integration/chat-plugin/BUILD | 1 + integration/chat-plugin/websocket_test.spec.ts | 12 ------------ integration/ui/BUILD | 1 + 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/integration/chat-plugin/BUILD b/integration/chat-plugin/BUILD index ff2ad9094e..d49185a5b7 100644 --- a/integration/chat-plugin/BUILD +++ b/integration/chat-plugin/BUILD @@ -14,6 +14,7 @@ ts_web_library( "esnext", "dom", ], + "typeRoots": ["../commands/index.ts"], "types": [ "cypress", "node", diff --git a/integration/chat-plugin/websocket_test.spec.ts b/integration/chat-plugin/websocket_test.spec.ts index 5415747cec..ce549d9c83 100644 --- a/integration/chat-plugin/websocket_test.spec.ts +++ b/integration/chat-plugin/websocket_test.spec.ts @@ -1,17 +1,5 @@ import {cyChatPluginMessageList} from 'chat-plugin-handles'; -declare global { - namespace Cypress { - interface Chainable { - createChatPluginConversation(): Chainable; - editContactDetails(): Chainable; - connectChatPluginConnector(): Chainable; - editDisplayName(): Chainable; - listConversationsForContact(): Chainable; - } - } -} - describe('Websocket test', () => { it('Send message from Inbox to Chatplugin and assert Websocket is working', () => { cy.createChatPluginConversation(); diff --git a/integration/ui/BUILD b/integration/ui/BUILD index 64897dfe9e..8284bf899c 100644 --- a/integration/ui/BUILD +++ b/integration/ui/BUILD @@ -14,6 +14,7 @@ ts_web_library( "esnext", "dom", ], + "typeRoots": ["../commands/index.ts"], "types": [ "cypress", "node", From a42d461ebe79d16802d02d6e5b2bd9aa8cd83b8e Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Tue, 2 Aug 2022 11:19:26 +0200 Subject: [PATCH 09/32] global type fix --- integration/chat-plugin/BUILD | 1 - integration/commands/index.ts | 12 ------------ integration/cypress.config.ts | 12 ++++++++++++ integration/ui/BUILD | 1 - 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/integration/chat-plugin/BUILD b/integration/chat-plugin/BUILD index d49185a5b7..ff2ad9094e 100644 --- a/integration/chat-plugin/BUILD +++ b/integration/chat-plugin/BUILD @@ -14,7 +14,6 @@ ts_web_library( "esnext", "dom", ], - "typeRoots": ["../commands/index.ts"], "types": [ "cypress", "node", diff --git a/integration/commands/index.ts b/integration/commands/index.ts index 9018a7e681..6f5b8c8003 100644 --- a/integration/commands/index.ts +++ b/integration/commands/index.ts @@ -3,18 +3,6 @@ import {editContactDetails} from './editContactDetails'; import {editDisplayName} from './editDisplayName'; import {listConversationsForContact} from './listConversationsForContact'; -declare global { - namespace Cypress { - interface Chainable { - createChatPluginConversation(): Chainable; - editContactDetails(): Chainable; - connectChatPluginConnector(): Chainable; - editDisplayName(): Chainable; - listConversationsForContact(): Chainable; - } - } -} - Cypress.Commands.add('createChatPluginConversation', createChatPluginConversation); Cypress.Commands.add('editContactDetails', editContactDetails); Cypress.Commands.add('connectChatPluginConnector', connectChatPluginConnector); diff --git a/integration/cypress.config.ts b/integration/cypress.config.ts index bb6a59bf72..6b5955f4ba 100644 --- a/integration/cypress.config.ts +++ b/integration/cypress.config.ts @@ -1,5 +1,17 @@ import {defineConfig} from 'cypress'; +declare global { + namespace Cypress { + interface Chainable { + createChatPluginConversation(): Chainable; + editContactDetails(): Chainable; + connectChatPluginConnector(): Chainable; + editDisplayName(): Chainable; + listConversationsForContact(): Chainable; + } + } +} + export default defineConfig({ e2e: { baseUrl: 'http://localhost', diff --git a/integration/ui/BUILD b/integration/ui/BUILD index 8284bf899c..64897dfe9e 100644 --- a/integration/ui/BUILD +++ b/integration/ui/BUILD @@ -14,7 +14,6 @@ ts_web_library( "esnext", "dom", ], - "typeRoots": ["../commands/index.ts"], "types": [ "cypress", "node", From ea64c759b959eccf26f1764f827c3aa182335098 Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Tue, 2 Aug 2022 11:45:46 +0200 Subject: [PATCH 10/32] fix cypress tests bazel --- integration/chat-plugin/BUILD | 1 + integration/commands/index.ts | 12 ++++++++++++ integration/cypress.config.ts | 12 ------------ integration/ui/BUILD | 1 + 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/integration/chat-plugin/BUILD b/integration/chat-plugin/BUILD index ff2ad9094e..13a97f815e 100644 --- a/integration/chat-plugin/BUILD +++ b/integration/chat-plugin/BUILD @@ -23,6 +23,7 @@ ts_web_library( deps = [ "//frontend/chat-plugin/handles:chat-plugin-handles", "//frontend/inbox/handles", + "//integration/commands", "@npm//cypress", ], ) diff --git a/integration/commands/index.ts b/integration/commands/index.ts index 6f5b8c8003..9018a7e681 100644 --- a/integration/commands/index.ts +++ b/integration/commands/index.ts @@ -3,6 +3,18 @@ import {editContactDetails} from './editContactDetails'; import {editDisplayName} from './editDisplayName'; import {listConversationsForContact} from './listConversationsForContact'; +declare global { + namespace Cypress { + interface Chainable { + createChatPluginConversation(): Chainable; + editContactDetails(): Chainable; + connectChatPluginConnector(): Chainable; + editDisplayName(): Chainable; + listConversationsForContact(): Chainable; + } + } +} + Cypress.Commands.add('createChatPluginConversation', createChatPluginConversation); Cypress.Commands.add('editContactDetails', editContactDetails); Cypress.Commands.add('connectChatPluginConnector', connectChatPluginConnector); diff --git a/integration/cypress.config.ts b/integration/cypress.config.ts index 6b5955f4ba..bb6a59bf72 100644 --- a/integration/cypress.config.ts +++ b/integration/cypress.config.ts @@ -1,17 +1,5 @@ import {defineConfig} from 'cypress'; -declare global { - namespace Cypress { - interface Chainable { - createChatPluginConversation(): Chainable; - editContactDetails(): Chainable; - connectChatPluginConnector(): Chainable; - editDisplayName(): Chainable; - listConversationsForContact(): Chainable; - } - } -} - export default defineConfig({ e2e: { baseUrl: 'http://localhost', diff --git a/integration/ui/BUILD b/integration/ui/BUILD index 64897dfe9e..dbf8b5772c 100644 --- a/integration/ui/BUILD +++ b/integration/ui/BUILD @@ -23,6 +23,7 @@ ts_web_library( deps = [ "//frontend/chat-plugin/handles:chat-plugin-handles", "//frontend/inbox/handles", + "//integration/commands", "@npm//@types/node", "@npm//cypress", ], From 09d542ff44177721be1c252a445dc123ea1c4010 Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Tue, 2 Aug 2022 12:25:53 +0200 Subject: [PATCH 11/32] typing fix --- integration/commands/createChatPluginConversation.ts | 8 ++++++++ integration/commands/editContactDetails.ts | 8 ++++++++ integration/commands/editDisplayName.ts | 8 ++++++++ integration/commands/index.ts | 12 ------------ integration/commands/listConversationsForContact.ts | 8 ++++++++ tsconfig.json | 5 +++-- 6 files changed, 35 insertions(+), 14 deletions(-) diff --git a/integration/commands/createChatPluginConversation.ts b/integration/commands/createChatPluginConversation.ts index 35ccb3e065..67bd22cde4 100644 --- a/integration/commands/createChatPluginConversation.ts +++ b/integration/commands/createChatPluginConversation.ts @@ -9,6 +9,14 @@ import { } from 'handles'; import {cyInputbarButton, cyInputbarTextarea} from 'chat-plugin-handles'; +declare global { + namespace Cypress { + interface Chainable { + createChatPluginConversation(): Chainable; + } + } +} + export const connectChatPluginConnector = (): void => { cy.get(`[data-cy=${cyChannelsChatPluginAddButton}]`).click(); cy.get(`[data-cy=${cyConnectorsAddNewButton}]`).first().click({force: true}); diff --git a/integration/commands/editContactDetails.ts b/integration/commands/editContactDetails.ts index 58a4bd940f..2e4583af0f 100644 --- a/integration/commands/editContactDetails.ts +++ b/integration/commands/editContactDetails.ts @@ -10,6 +10,14 @@ import { cyContactExtendable, } from 'handles'; +declare global { + namespace Cypress { + interface Chainable { + editContactDetails(): Chainable; + } + } +} + export const editContactDetails = (): void => { it('displays default values if there is no information', () => { cy.get(`[data-cy=${cyContactEmail}]`).clear(); diff --git a/integration/commands/editDisplayName.ts b/integration/commands/editDisplayName.ts index 1593e4d3bf..caae3bcc8a 100644 --- a/integration/commands/editDisplayName.ts +++ b/integration/commands/editDisplayName.ts @@ -1,5 +1,13 @@ import {cyEditDisplayNameIcon, cyDisplayName, cyDisplayNameInput, cyEditDisplayNameCheckmark} from 'handles'; +declare global { + namespace Cypress { + interface Chainable { + editDisplayName(): Chainable; + } + } +} + export const editDisplayName = (): void => { cy.get(`[data-cy=${cyEditDisplayNameIcon}]`).click({force: true}); cy.wait(500); diff --git a/integration/commands/index.ts b/integration/commands/index.ts index 9018a7e681..6f5b8c8003 100644 --- a/integration/commands/index.ts +++ b/integration/commands/index.ts @@ -3,18 +3,6 @@ import {editContactDetails} from './editContactDetails'; import {editDisplayName} from './editDisplayName'; import {listConversationsForContact} from './listConversationsForContact'; -declare global { - namespace Cypress { - interface Chainable { - createChatPluginConversation(): Chainable; - editContactDetails(): Chainable; - connectChatPluginConnector(): Chainable; - editDisplayName(): Chainable; - listConversationsForContact(): Chainable; - } - } -} - Cypress.Commands.add('createChatPluginConversation', createChatPluginConversation); Cypress.Commands.add('editContactDetails', editContactDetails); Cypress.Commands.add('connectChatPluginConnector', connectChatPluginConnector); diff --git a/integration/commands/listConversationsForContact.ts b/integration/commands/listConversationsForContact.ts index 0a505a068b..563a288d0b 100644 --- a/integration/commands/listConversationsForContact.ts +++ b/integration/commands/listConversationsForContact.ts @@ -1,5 +1,13 @@ import {cyConversationsListForContact, cyConversationForContactButton} from 'handles'; +declare global { + namespace Cypress { + interface Chainable { + listConversationsForContact(): Chainable; + } + } +} + export const listConversationsForContact = (): void => { cy.get(`[data-cy=${cyConversationsListForContact}]`).should('be.visible'); cy.get(`[data-cy=${cyConversationForContactButton}]`).first().click(); diff --git a/tsconfig.json b/tsconfig.json index db9c23683f..130308e6e2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,8 +5,9 @@ }, "include": [ "./frontend/**/*", - "./lib/typescript/**/*" + "./lib/typescript/**/*", + "./integration/commands/*/*.ts" ], - "types": ["node", "jest", "@testing-library/jest-dom"], + "types": ["node", "jest", "@testing-library/jest-dom", "cypress"], "rootDirs": ["."] } From b6ff4da0bc5da9017616377dc041e98d5e119bc4 Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Tue, 2 Aug 2022 14:07:15 +0200 Subject: [PATCH 12/32] type fix --- integration/commands/BUILD | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/integration/commands/BUILD b/integration/commands/BUILD index f73c6cda03..4ece86b569 100644 --- a/integration/commands/BUILD +++ b/integration/commands/BUILD @@ -14,7 +14,10 @@ ts_web_library( "esnext", "dom", ], - "types": ["cypress"], + "types": [ + "cypress", + "node", + ], }, }, deps = [ From 62b617dae3811466fdf072a143b744173e5e8126 Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Tue, 2 Aug 2022 14:43:45 +0200 Subject: [PATCH 13/32] typings --- integration/commands/BUILD | 4 ---- 1 file changed, 4 deletions(-) diff --git a/integration/commands/BUILD b/integration/commands/BUILD index 4ece86b569..e078a20804 100644 --- a/integration/commands/BUILD +++ b/integration/commands/BUILD @@ -10,10 +10,6 @@ ts_web_library( srcs = glob(["*.spec.ts"]), tsconfig = { "compilerOptions": { - "lib": [ - "esnext", - "dom", - ], "types": [ "cypress", "node", From 49211aa2ec0d32f2650bd2c96e73102a9d6260ac Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Tue, 2 Aug 2022 15:55:47 +0200 Subject: [PATCH 14/32] fixing --- integration/commands/BUILD | 2 +- integration/commands/createChatPluginConversation.ts | 8 -------- integration/commands/editContactDetails.ts | 8 -------- integration/commands/editDisplayName.ts | 8 -------- integration/commands/index.ts | 12 ++++++++++++ integration/commands/listConversationsForContact.ts | 8 -------- 6 files changed, 13 insertions(+), 33 deletions(-) diff --git a/integration/commands/BUILD b/integration/commands/BUILD index e078a20804..258cd4ae3f 100644 --- a/integration/commands/BUILD +++ b/integration/commands/BUILD @@ -7,7 +7,7 @@ package(default_visibility = ["//visibility:public"]) ts_web_library( name = "commands", - srcs = glob(["*.spec.ts"]), + srcs = ["index.ts"], tsconfig = { "compilerOptions": { "types": [ diff --git a/integration/commands/createChatPluginConversation.ts b/integration/commands/createChatPluginConversation.ts index 67bd22cde4..35ccb3e065 100644 --- a/integration/commands/createChatPluginConversation.ts +++ b/integration/commands/createChatPluginConversation.ts @@ -9,14 +9,6 @@ import { } from 'handles'; import {cyInputbarButton, cyInputbarTextarea} from 'chat-plugin-handles'; -declare global { - namespace Cypress { - interface Chainable { - createChatPluginConversation(): Chainable; - } - } -} - export const connectChatPluginConnector = (): void => { cy.get(`[data-cy=${cyChannelsChatPluginAddButton}]`).click(); cy.get(`[data-cy=${cyConnectorsAddNewButton}]`).first().click({force: true}); diff --git a/integration/commands/editContactDetails.ts b/integration/commands/editContactDetails.ts index 2e4583af0f..58a4bd940f 100644 --- a/integration/commands/editContactDetails.ts +++ b/integration/commands/editContactDetails.ts @@ -10,14 +10,6 @@ import { cyContactExtendable, } from 'handles'; -declare global { - namespace Cypress { - interface Chainable { - editContactDetails(): Chainable; - } - } -} - export const editContactDetails = (): void => { it('displays default values if there is no information', () => { cy.get(`[data-cy=${cyContactEmail}]`).clear(); diff --git a/integration/commands/editDisplayName.ts b/integration/commands/editDisplayName.ts index caae3bcc8a..1593e4d3bf 100644 --- a/integration/commands/editDisplayName.ts +++ b/integration/commands/editDisplayName.ts @@ -1,13 +1,5 @@ import {cyEditDisplayNameIcon, cyDisplayName, cyDisplayNameInput, cyEditDisplayNameCheckmark} from 'handles'; -declare global { - namespace Cypress { - interface Chainable { - editDisplayName(): Chainable; - } - } -} - export const editDisplayName = (): void => { cy.get(`[data-cy=${cyEditDisplayNameIcon}]`).click({force: true}); cy.wait(500); diff --git a/integration/commands/index.ts b/integration/commands/index.ts index 6f5b8c8003..9018a7e681 100644 --- a/integration/commands/index.ts +++ b/integration/commands/index.ts @@ -3,6 +3,18 @@ import {editContactDetails} from './editContactDetails'; import {editDisplayName} from './editDisplayName'; import {listConversationsForContact} from './listConversationsForContact'; +declare global { + namespace Cypress { + interface Chainable { + createChatPluginConversation(): Chainable; + editContactDetails(): Chainable; + connectChatPluginConnector(): Chainable; + editDisplayName(): Chainable; + listConversationsForContact(): Chainable; + } + } +} + Cypress.Commands.add('createChatPluginConversation', createChatPluginConversation); Cypress.Commands.add('editContactDetails', editContactDetails); Cypress.Commands.add('connectChatPluginConnector', connectChatPluginConnector); diff --git a/integration/commands/listConversationsForContact.ts b/integration/commands/listConversationsForContact.ts index 563a288d0b..0a505a068b 100644 --- a/integration/commands/listConversationsForContact.ts +++ b/integration/commands/listConversationsForContact.ts @@ -1,13 +1,5 @@ import {cyConversationsListForContact, cyConversationForContactButton} from 'handles'; -declare global { - namespace Cypress { - interface Chainable { - listConversationsForContact(): Chainable; - } - } -} - export const listConversationsForContact = (): void => { cy.get(`[data-cy=${cyConversationsListForContact}]`).should('be.visible'); cy.get(`[data-cy=${cyConversationForContactButton}]`).first().click(); From 131ec694dac43b87f97490f0ddb02d27ffccfed9 Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Tue, 2 Aug 2022 16:26:50 +0200 Subject: [PATCH 15/32] typing fix --- integration/commands/BUILD | 1 - integration/commands/index.ts | 12 ++++++------ integration/tsconfig.json | 8 ++++++++ tsconfig.json | 3 +-- 4 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 integration/tsconfig.json diff --git a/integration/commands/BUILD b/integration/commands/BUILD index 258cd4ae3f..ab17bbf14f 100644 --- a/integration/commands/BUILD +++ b/integration/commands/BUILD @@ -7,7 +7,6 @@ package(default_visibility = ["//visibility:public"]) ts_web_library( name = "commands", - srcs = ["index.ts"], tsconfig = { "compilerOptions": { "types": [ diff --git a/integration/commands/index.ts b/integration/commands/index.ts index 9018a7e681..2f3baf9280 100644 --- a/integration/commands/index.ts +++ b/integration/commands/index.ts @@ -5,12 +5,12 @@ import {listConversationsForContact} from './listConversationsForContact'; declare global { namespace Cypress { - interface Chainable { - createChatPluginConversation(): Chainable; - editContactDetails(): Chainable; - connectChatPluginConnector(): Chainable; - editDisplayName(): Chainable; - listConversationsForContact(): Chainable; + interface Chainable { + createChatPluginConversation(): Chainable; + editContactDetails(): Chainable; + connectChatPluginConnector(): Chainable; + editDisplayName(): Chainable; + listConversationsForContact(): Chainable; } } } diff --git a/integration/tsconfig.json b/integration/tsconfig.json new file mode 100644 index 0000000000..966be2877c --- /dev/null +++ b/integration/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "target": "es5", + "lib": ["es5", "dom"], + "types": ["cypress", "node"] + }, + "include": ["**/*.ts"] + } \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 130308e6e2..41732d36f4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,8 +6,7 @@ "include": [ "./frontend/**/*", "./lib/typescript/**/*", - "./integration/commands/*/*.ts" ], - "types": ["node", "jest", "@testing-library/jest-dom", "cypress"], + "types": ["node", "jest", "@testing-library/jest-dom"], "rootDirs": ["."] } From 0b5c6179b37e680a9ebd344b50e3d40d58a6b74e Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Tue, 2 Aug 2022 17:42:11 +0200 Subject: [PATCH 16/32] type fix --- integration/chat-plugin/BUILD | 1 - integration/ui/BUILD | 1 - 2 files changed, 2 deletions(-) diff --git a/integration/chat-plugin/BUILD b/integration/chat-plugin/BUILD index 13a97f815e..ff2ad9094e 100644 --- a/integration/chat-plugin/BUILD +++ b/integration/chat-plugin/BUILD @@ -23,7 +23,6 @@ ts_web_library( deps = [ "//frontend/chat-plugin/handles:chat-plugin-handles", "//frontend/inbox/handles", - "//integration/commands", "@npm//cypress", ], ) diff --git a/integration/ui/BUILD b/integration/ui/BUILD index dbf8b5772c..64897dfe9e 100644 --- a/integration/ui/BUILD +++ b/integration/ui/BUILD @@ -23,7 +23,6 @@ ts_web_library( deps = [ "//frontend/chat-plugin/handles:chat-plugin-handles", "//frontend/inbox/handles", - "//integration/commands", "@npm//@types/node", "@npm//cypress", ], From bded32ce0251832e3144fd38923a400c6a52d88b Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Tue, 2 Aug 2022 18:54:58 +0200 Subject: [PATCH 17/32] lint --- integration/BUILD | 1 + integration/tsconfig.json | 8 -------- tsconfig.json | 3 ++- 3 files changed, 3 insertions(+), 9 deletions(-) delete mode 100644 integration/tsconfig.json diff --git a/integration/BUILD b/integration/BUILD index e11df3e477..f7a5608234 100644 --- a/integration/BUILD +++ b/integration/BUILD @@ -27,6 +27,7 @@ nodejs_binary( "//integration/chat-plugin", "//integration/commands", "//integration/ui", + "@npm//@types/node", "@npm//cypress", ], entry_point = { diff --git a/integration/tsconfig.json b/integration/tsconfig.json deleted file mode 100644 index 966be2877c..0000000000 --- a/integration/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "target": "es5", - "lib": ["es5", "dom"], - "types": ["cypress", "node"] - }, - "include": ["**/*.ts"] - } \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 41732d36f4..107d25fdf6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,7 +6,8 @@ "include": [ "./frontend/**/*", "./lib/typescript/**/*", + "./integration/**/*", ], - "types": ["node", "jest", "@testing-library/jest-dom"], + "types": ["node", "jest", "@testing-library/jest-dom", "cypress"], "rootDirs": ["."] } From 0ed9f9442573d60ac343491e0c691ad30400f57a Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Tue, 2 Aug 2022 19:01:26 +0200 Subject: [PATCH 18/32] fix unit testing --- lib/typescript/types/global.d.ts | 10 ++++++++++ tsconfig.json | 3 +-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/typescript/types/global.d.ts b/lib/typescript/types/global.d.ts index 43e86d8d52..b0c14369bd 100644 --- a/lib/typescript/types/global.d.ts +++ b/lib/typescript/types/global.d.ts @@ -52,3 +52,13 @@ declare module '*.json'; declare type Dictionary = { [key: string]: T; }; + +declare namespace Cypress { + interface Chainable { + createChatPluginConversation(): Chainable; + editContactDetails(): Chainable; + connectChatPluginConnector(): Chainable; + editDisplayName(): Chainable; + listConversationsForContact(): Chainable; + } +} diff --git a/tsconfig.json b/tsconfig.json index 107d25fdf6..faebd2aa94 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,8 +6,7 @@ "include": [ "./frontend/**/*", "./lib/typescript/**/*", - "./integration/**/*", ], - "types": ["node", "jest", "@testing-library/jest-dom", "cypress"], + "types": ["node", "@testing-library/jest-dom", "jest", "cypress"], "rootDirs": ["."] } From 173ad23eaba714ef0183e9ab5e44ff798041a47d Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Tue, 2 Aug 2022 19:18:42 +0200 Subject: [PATCH 19/32] fix --- lib/typescript/types/global.d.ts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/lib/typescript/types/global.d.ts b/lib/typescript/types/global.d.ts index b0c14369bd..43e86d8d52 100644 --- a/lib/typescript/types/global.d.ts +++ b/lib/typescript/types/global.d.ts @@ -52,13 +52,3 @@ declare module '*.json'; declare type Dictionary = { [key: string]: T; }; - -declare namespace Cypress { - interface Chainable { - createChatPluginConversation(): Chainable; - editContactDetails(): Chainable; - connectChatPluginConnector(): Chainable; - editDisplayName(): Chainable; - listConversationsForContact(): Chainable; - } -} From fe46d5d5505d5a2238b8189f4f37d700f762f61f Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Wed, 3 Aug 2022 10:08:55 +0200 Subject: [PATCH 20/32] added index.d.ts type --- integration/chat-plugin/BUILD | 1 + integration/commands/BUILD | 4 ++++ integration/commands/index.ts | 12 ------------ integration/index.d.ts | 11 +++++++++++ integration/ui/BUILD | 1 + 5 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 integration/index.d.ts diff --git a/integration/chat-plugin/BUILD b/integration/chat-plugin/BUILD index ff2ad9094e..13a97f815e 100644 --- a/integration/chat-plugin/BUILD +++ b/integration/chat-plugin/BUILD @@ -23,6 +23,7 @@ ts_web_library( deps = [ "//frontend/chat-plugin/handles:chat-plugin-handles", "//frontend/inbox/handles", + "//integration/commands", "@npm//cypress", ], ) diff --git a/integration/commands/BUILD b/integration/commands/BUILD index ab17bbf14f..860023c6a1 100644 --- a/integration/commands/BUILD +++ b/integration/commands/BUILD @@ -9,6 +9,10 @@ ts_web_library( name = "commands", tsconfig = { "compilerOptions": { + "lib": [ + "esnext", + "dom", + ], "types": [ "cypress", "node", diff --git a/integration/commands/index.ts b/integration/commands/index.ts index 2f3baf9280..6f5b8c8003 100644 --- a/integration/commands/index.ts +++ b/integration/commands/index.ts @@ -3,18 +3,6 @@ import {editContactDetails} from './editContactDetails'; import {editDisplayName} from './editDisplayName'; import {listConversationsForContact} from './listConversationsForContact'; -declare global { - namespace Cypress { - interface Chainable { - createChatPluginConversation(): Chainable; - editContactDetails(): Chainable; - connectChatPluginConnector(): Chainable; - editDisplayName(): Chainable; - listConversationsForContact(): Chainable; - } - } -} - Cypress.Commands.add('createChatPluginConversation', createChatPluginConversation); Cypress.Commands.add('editContactDetails', editContactDetails); Cypress.Commands.add('connectChatPluginConnector', connectChatPluginConnector); diff --git a/integration/index.d.ts b/integration/index.d.ts new file mode 100644 index 0000000000..cbaeb69e9f --- /dev/null +++ b/integration/index.d.ts @@ -0,0 +1,11 @@ +/// + +declare namespace Cypress { + interface Chainable { + createChatPluginConversation(): Chainable; + editContactDetails(): Chainable; + connectChatPluginConnector(): Chainable; + editDisplayName(): Chainable; + listConversationsForContact(): Chainable; + } +} diff --git a/integration/ui/BUILD b/integration/ui/BUILD index 64897dfe9e..dbf8b5772c 100644 --- a/integration/ui/BUILD +++ b/integration/ui/BUILD @@ -23,6 +23,7 @@ ts_web_library( deps = [ "//frontend/chat-plugin/handles:chat-plugin-handles", "//frontend/inbox/handles", + "//integration/commands", "@npm//@types/node", "@npm//cypress", ], From 30b20e5364926c471bc344a9830e91a0d5ed4e4b Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Wed, 3 Aug 2022 10:42:28 +0200 Subject: [PATCH 21/32] fixes --- integration/commands/BUILD | 5 +---- integration/ui/connect_chatplugin.spec.ts | 12 ++++++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/integration/commands/BUILD b/integration/commands/BUILD index 860023c6a1..143bb67673 100644 --- a/integration/commands/BUILD +++ b/integration/commands/BUILD @@ -13,10 +13,7 @@ ts_web_library( "esnext", "dom", ], - "types": [ - "cypress", - "node", - ], + "types": ["cypress"], }, }, deps = [ diff --git a/integration/ui/connect_chatplugin.spec.ts b/integration/ui/connect_chatplugin.spec.ts index 944fa389bb..9dc2e09d7b 100644 --- a/integration/ui/connect_chatplugin.spec.ts +++ b/integration/ui/connect_chatplugin.spec.ts @@ -1,5 +1,17 @@ import {cyChannelsFormBackButton, cyChannelsChatPluginList} from 'handles'; +// declare global { +// namespace Cypress { +// interface Chainable { +// createChatPluginConversation(): Chainable; +// editContactDetails(): Chainable; +// connectChatPluginConnector(): Chainable; +// editDisplayName(): Chainable; +// listConversationsForContact(): Chainable; +// } +// } +// } + describe('Connect chatplugin channel', () => { it('Connect chatplugin channel', () => { cy.visit('/control-center/connectors'); From 36a395015381a2d055648155bed9986bd3588195 Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Wed, 3 Aug 2022 10:56:34 +0200 Subject: [PATCH 22/32] fix build file --- integration/commands/index.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/integration/commands/index.ts b/integration/commands/index.ts index 6f5b8c8003..f538f73693 100644 --- a/integration/commands/index.ts +++ b/integration/commands/index.ts @@ -1,8 +1,21 @@ +/// import {connectChatPluginConnector, createChatPluginConversation} from './createChatPluginConversation'; import {editContactDetails} from './editContactDetails'; import {editDisplayName} from './editDisplayName'; import {listConversationsForContact} from './listConversationsForContact'; +declare global { + namespace Cypress { + interface Chainable { + createChatPluginConversation(): Chainable; + editContactDetails(): Chainable; + connectChatPluginConnector(): Chainable; + editDisplayName(): Chainable; + listConversationsForContact(): Chainable; + } + } +} + Cypress.Commands.add('createChatPluginConversation', createChatPluginConversation); Cypress.Commands.add('editContactDetails', editContactDetails); Cypress.Commands.add('connectChatPluginConnector', connectChatPluginConnector); From 45c0f954688922ab1577cc507e4e6f28554cc716 Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Wed, 3 Aug 2022 11:34:27 +0200 Subject: [PATCH 23/32] type fix again --- integration/ui/BUILD | 1 - integration/ui/connect_chatplugin.spec.ts | 12 ------------ 2 files changed, 13 deletions(-) diff --git a/integration/ui/BUILD b/integration/ui/BUILD index dbf8b5772c..64897dfe9e 100644 --- a/integration/ui/BUILD +++ b/integration/ui/BUILD @@ -23,7 +23,6 @@ ts_web_library( deps = [ "//frontend/chat-plugin/handles:chat-plugin-handles", "//frontend/inbox/handles", - "//integration/commands", "@npm//@types/node", "@npm//cypress", ], diff --git a/integration/ui/connect_chatplugin.spec.ts b/integration/ui/connect_chatplugin.spec.ts index 9dc2e09d7b..944fa389bb 100644 --- a/integration/ui/connect_chatplugin.spec.ts +++ b/integration/ui/connect_chatplugin.spec.ts @@ -1,17 +1,5 @@ import {cyChannelsFormBackButton, cyChannelsChatPluginList} from 'handles'; -// declare global { -// namespace Cypress { -// interface Chainable { -// createChatPluginConversation(): Chainable; -// editContactDetails(): Chainable; -// connectChatPluginConnector(): Chainable; -// editDisplayName(): Chainable; -// listConversationsForContact(): Chainable; -// } -// } -// } - describe('Connect chatplugin channel', () => { it('Connect chatplugin channel', () => { cy.visit('/control-center/connectors'); From 95017dde90d532302d9c72735fc799bb11612c46 Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Wed, 3 Aug 2022 11:55:49 +0200 Subject: [PATCH 24/32] fix type --- integration/chat-plugin/BUILD | 2 +- integration/chat-plugin/websocket_test.spec.ts | 12 ++++++++++++ integration/ui/connect_chatplugin.spec.ts | 12 ++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/integration/chat-plugin/BUILD b/integration/chat-plugin/BUILD index 13a97f815e..095a56dffd 100644 --- a/integration/chat-plugin/BUILD +++ b/integration/chat-plugin/BUILD @@ -23,7 +23,7 @@ ts_web_library( deps = [ "//frontend/chat-plugin/handles:chat-plugin-handles", "//frontend/inbox/handles", - "//integration/commands", + "@npm//@types/node", "@npm//cypress", ], ) diff --git a/integration/chat-plugin/websocket_test.spec.ts b/integration/chat-plugin/websocket_test.spec.ts index ce549d9c83..5415747cec 100644 --- a/integration/chat-plugin/websocket_test.spec.ts +++ b/integration/chat-plugin/websocket_test.spec.ts @@ -1,5 +1,17 @@ import {cyChatPluginMessageList} from 'chat-plugin-handles'; +declare global { + namespace Cypress { + interface Chainable { + createChatPluginConversation(): Chainable; + editContactDetails(): Chainable; + connectChatPluginConnector(): Chainable; + editDisplayName(): Chainable; + listConversationsForContact(): Chainable; + } + } +} + describe('Websocket test', () => { it('Send message from Inbox to Chatplugin and assert Websocket is working', () => { cy.createChatPluginConversation(); diff --git a/integration/ui/connect_chatplugin.spec.ts b/integration/ui/connect_chatplugin.spec.ts index 944fa389bb..ab7a23c2f1 100644 --- a/integration/ui/connect_chatplugin.spec.ts +++ b/integration/ui/connect_chatplugin.spec.ts @@ -1,5 +1,17 @@ import {cyChannelsFormBackButton, cyChannelsChatPluginList} from 'handles'; +declare global { + namespace Cypress { + interface Chainable { + createChatPluginConversation(): Chainable; + editContactDetails(): Chainable; + connectChatPluginConnector(): Chainable; + editDisplayName(): Chainable; + listConversationsForContact(): Chainable; + } + } +} + describe('Connect chatplugin channel', () => { it('Connect chatplugin channel', () => { cy.visit('/control-center/connectors'); From 1fcc851e0a49dabb0a0dce369d1f376ccdfbc5a4 Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Thu, 4 Aug 2022 11:46:42 +0200 Subject: [PATCH 25/32] tsconfig fix --- integration/chat-plugin/websocket_test.spec.ts | 12 ------------ integration/commands/index.ts | 1 - integration/index.d.ts | 11 ----------- integration/ui/connect_chatplugin.spec.ts | 12 ------------ tsconfig.json | 1 + 5 files changed, 1 insertion(+), 36 deletions(-) delete mode 100644 integration/index.d.ts diff --git a/integration/chat-plugin/websocket_test.spec.ts b/integration/chat-plugin/websocket_test.spec.ts index 5415747cec..ce549d9c83 100644 --- a/integration/chat-plugin/websocket_test.spec.ts +++ b/integration/chat-plugin/websocket_test.spec.ts @@ -1,17 +1,5 @@ import {cyChatPluginMessageList} from 'chat-plugin-handles'; -declare global { - namespace Cypress { - interface Chainable { - createChatPluginConversation(): Chainable; - editContactDetails(): Chainable; - connectChatPluginConnector(): Chainable; - editDisplayName(): Chainable; - listConversationsForContact(): Chainable; - } - } -} - describe('Websocket test', () => { it('Send message from Inbox to Chatplugin and assert Websocket is working', () => { cy.createChatPluginConversation(); diff --git a/integration/commands/index.ts b/integration/commands/index.ts index f538f73693..9018a7e681 100644 --- a/integration/commands/index.ts +++ b/integration/commands/index.ts @@ -1,4 +1,3 @@ -/// import {connectChatPluginConnector, createChatPluginConversation} from './createChatPluginConversation'; import {editContactDetails} from './editContactDetails'; import {editDisplayName} from './editDisplayName'; diff --git a/integration/index.d.ts b/integration/index.d.ts deleted file mode 100644 index cbaeb69e9f..0000000000 --- a/integration/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/// - -declare namespace Cypress { - interface Chainable { - createChatPluginConversation(): Chainable; - editContactDetails(): Chainable; - connectChatPluginConnector(): Chainable; - editDisplayName(): Chainable; - listConversationsForContact(): Chainable; - } -} diff --git a/integration/ui/connect_chatplugin.spec.ts b/integration/ui/connect_chatplugin.spec.ts index ab7a23c2f1..944fa389bb 100644 --- a/integration/ui/connect_chatplugin.spec.ts +++ b/integration/ui/connect_chatplugin.spec.ts @@ -1,17 +1,5 @@ import {cyChannelsFormBackButton, cyChannelsChatPluginList} from 'handles'; -declare global { - namespace Cypress { - interface Chainable { - createChatPluginConversation(): Chainable; - editContactDetails(): Chainable; - connectChatPluginConnector(): Chainable; - editDisplayName(): Chainable; - listConversationsForContact(): Chainable; - } - } -} - describe('Connect chatplugin channel', () => { it('Connect chatplugin channel', () => { cy.visit('/control-center/connectors'); diff --git a/tsconfig.json b/tsconfig.json index faebd2aa94..7c5ebfe197 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,6 +6,7 @@ "include": [ "./frontend/**/*", "./lib/typescript/**/*", + "./integration" ], "types": ["node", "@testing-library/jest-dom", "jest", "cypress"], "rootDirs": ["."] From 0a66c5d7173d93d75fe6314a46a790f96e54432f Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Thu, 4 Aug 2022 12:22:59 +0200 Subject: [PATCH 26/32] type fix --- integration/cypress.config.ts | 2 +- integration/{commands => support}/BUILD | 4 +++- .../createChatPluginConversation.ts | 0 integration/support/cypress.d.ts | 9 +++++++++ .../{commands => support}/editContactDetails.ts | 0 integration/{commands => support}/editDisplayName.ts | 0 integration/{commands => support}/index.ts | 12 ------------ .../listConversationsForContact.ts | 0 integration/tsconfigCy.json | 10 ++++++++++ tsconfig.json | 3 +-- 10 files changed, 24 insertions(+), 16 deletions(-) rename integration/{commands => support}/BUILD (90%) rename integration/{commands => support}/createChatPluginConversation.ts (100%) create mode 100644 integration/support/cypress.d.ts rename integration/{commands => support}/editContactDetails.ts (100%) rename integration/{commands => support}/editDisplayName.ts (100%) rename integration/{commands => support}/index.ts (65%) rename integration/{commands => support}/listConversationsForContact.ts (100%) create mode 100644 integration/tsconfigCy.json diff --git a/integration/cypress.config.ts b/integration/cypress.config.ts index bb6a59bf72..100214da94 100644 --- a/integration/cypress.config.ts +++ b/integration/cypress.config.ts @@ -4,7 +4,7 @@ export default defineConfig({ e2e: { baseUrl: 'http://localhost', specPattern: 'integration/**/*.spec.?s', - supportFile: 'integration/commands/index.ts', + supportFile: 'integration/support/index.ts', }, env: { chatPluginName: 'Cypress Chatplugin', diff --git a/integration/commands/BUILD b/integration/support/BUILD similarity index 90% rename from integration/commands/BUILD rename to integration/support/BUILD index 143bb67673..edb03ba6cc 100644 --- a/integration/commands/BUILD +++ b/integration/support/BUILD @@ -13,7 +13,9 @@ ts_web_library( "esnext", "dom", ], - "types": ["cypress"], + "types": [ + "cypress", + ], }, }, deps = [ diff --git a/integration/commands/createChatPluginConversation.ts b/integration/support/createChatPluginConversation.ts similarity index 100% rename from integration/commands/createChatPluginConversation.ts rename to integration/support/createChatPluginConversation.ts diff --git a/integration/support/cypress.d.ts b/integration/support/cypress.d.ts new file mode 100644 index 0000000000..ecf28bbf7d --- /dev/null +++ b/integration/support/cypress.d.ts @@ -0,0 +1,9 @@ +declare namespace Cypress { + interface Chainable { + createChatPluginConversation(): Chainable; + editContactDetails(): Chainable; + connectChatPluginConnector(): Chainable; + editDisplayName(): Chainable; + listConversationsForContact(): Chainable; + } +} diff --git a/integration/commands/editContactDetails.ts b/integration/support/editContactDetails.ts similarity index 100% rename from integration/commands/editContactDetails.ts rename to integration/support/editContactDetails.ts diff --git a/integration/commands/editDisplayName.ts b/integration/support/editDisplayName.ts similarity index 100% rename from integration/commands/editDisplayName.ts rename to integration/support/editDisplayName.ts diff --git a/integration/commands/index.ts b/integration/support/index.ts similarity index 65% rename from integration/commands/index.ts rename to integration/support/index.ts index 9018a7e681..6f5b8c8003 100644 --- a/integration/commands/index.ts +++ b/integration/support/index.ts @@ -3,18 +3,6 @@ import {editContactDetails} from './editContactDetails'; import {editDisplayName} from './editDisplayName'; import {listConversationsForContact} from './listConversationsForContact'; -declare global { - namespace Cypress { - interface Chainable { - createChatPluginConversation(): Chainable; - editContactDetails(): Chainable; - connectChatPluginConnector(): Chainable; - editDisplayName(): Chainable; - listConversationsForContact(): Chainable; - } - } -} - Cypress.Commands.add('createChatPluginConversation', createChatPluginConversation); Cypress.Commands.add('editContactDetails', editContactDetails); Cypress.Commands.add('connectChatPluginConnector', connectChatPluginConnector); diff --git a/integration/commands/listConversationsForContact.ts b/integration/support/listConversationsForContact.ts similarity index 100% rename from integration/commands/listConversationsForContact.ts rename to integration/support/listConversationsForContact.ts diff --git a/integration/tsconfigCy.json b/integration/tsconfigCy.json new file mode 100644 index 0000000000..af6f03d49c --- /dev/null +++ b/integration/tsconfigCy.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "target": "es5", + "lib": ["es5", "dom"], + "types": ["cypress", "node", "./support"] + }, + "include": [ + "**/*.ts" + ] +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 7c5ebfe197..810079195d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,8 +6,7 @@ "include": [ "./frontend/**/*", "./lib/typescript/**/*", - "./integration" ], - "types": ["node", "@testing-library/jest-dom", "jest", "cypress"], + "types": ["node", "@testing-library/jest-dom", "jest"], "rootDirs": ["."] } From 26025be20efb9a9020df4bbeac7ce1fd2fa4fe25 Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Thu, 4 Aug 2022 12:38:52 +0200 Subject: [PATCH 27/32] fix build file name --- integration/BUILD | 2 +- integration/support/BUILD | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/integration/BUILD b/integration/BUILD index f7a5608234..95753a948c 100644 --- a/integration/BUILD +++ b/integration/BUILD @@ -25,7 +25,7 @@ nodejs_binary( data = [ ":cypress.config.ts", "//integration/chat-plugin", - "//integration/commands", + "//integration/support", "//integration/ui", "@npm//@types/node", "@npm//cypress", diff --git a/integration/support/BUILD b/integration/support/BUILD index edb03ba6cc..f63a265afb 100644 --- a/integration/support/BUILD +++ b/integration/support/BUILD @@ -6,7 +6,7 @@ check_pkg(name = "buildifier") package(default_visibility = ["//visibility:public"]) ts_web_library( - name = "commands", + name = "support", tsconfig = { "compilerOptions": { "lib": [ From 59ee42a5f4d41457e26314c2f1950954d08efa5c Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Mon, 8 Aug 2022 19:08:36 +0200 Subject: [PATCH 28/32] typing fix --- integration/chat-plugin/websocket_test.spec.ts | 12 ++++++++++++ integration/support/cypress.d.ts | 9 --------- integration/support/index.ts | 12 ++++++++++++ integration/tsconfigCy.json | 10 ---------- integration/ui/connect_chatplugin.spec.ts | 12 ++++++++++++ tsconfig.json | 2 +- 6 files changed, 37 insertions(+), 20 deletions(-) delete mode 100644 integration/support/cypress.d.ts delete mode 100644 integration/tsconfigCy.json diff --git a/integration/chat-plugin/websocket_test.spec.ts b/integration/chat-plugin/websocket_test.spec.ts index ce549d9c83..cc8ffb3a32 100644 --- a/integration/chat-plugin/websocket_test.spec.ts +++ b/integration/chat-plugin/websocket_test.spec.ts @@ -1,5 +1,17 @@ import {cyChatPluginMessageList} from 'chat-plugin-handles'; +// declare global { +// namespace Cypress { +// interface Chainable { +// createChatPluginConversation(): Chainable; +// editContactDetails(): Chainable; +// connectChatPluginConnector(): Chainable; +// editDisplayName(): Chainable; +// listConversationsForContact(): Chainable; +// } +// } +// } + describe('Websocket test', () => { it('Send message from Inbox to Chatplugin and assert Websocket is working', () => { cy.createChatPluginConversation(); diff --git a/integration/support/cypress.d.ts b/integration/support/cypress.d.ts deleted file mode 100644 index ecf28bbf7d..0000000000 --- a/integration/support/cypress.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -declare namespace Cypress { - interface Chainable { - createChatPluginConversation(): Chainable; - editContactDetails(): Chainable; - connectChatPluginConnector(): Chainable; - editDisplayName(): Chainable; - listConversationsForContact(): Chainable; - } -} diff --git a/integration/support/index.ts b/integration/support/index.ts index 6f5b8c8003..9018a7e681 100644 --- a/integration/support/index.ts +++ b/integration/support/index.ts @@ -3,6 +3,18 @@ import {editContactDetails} from './editContactDetails'; import {editDisplayName} from './editDisplayName'; import {listConversationsForContact} from './listConversationsForContact'; +declare global { + namespace Cypress { + interface Chainable { + createChatPluginConversation(): Chainable; + editContactDetails(): Chainable; + connectChatPluginConnector(): Chainable; + editDisplayName(): Chainable; + listConversationsForContact(): Chainable; + } + } +} + Cypress.Commands.add('createChatPluginConversation', createChatPluginConversation); Cypress.Commands.add('editContactDetails', editContactDetails); Cypress.Commands.add('connectChatPluginConnector', connectChatPluginConnector); diff --git a/integration/tsconfigCy.json b/integration/tsconfigCy.json deleted file mode 100644 index af6f03d49c..0000000000 --- a/integration/tsconfigCy.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "compilerOptions": { - "target": "es5", - "lib": ["es5", "dom"], - "types": ["cypress", "node", "./support"] - }, - "include": [ - "**/*.ts" - ] -} \ No newline at end of file diff --git a/integration/ui/connect_chatplugin.spec.ts b/integration/ui/connect_chatplugin.spec.ts index 944fa389bb..9dc2e09d7b 100644 --- a/integration/ui/connect_chatplugin.spec.ts +++ b/integration/ui/connect_chatplugin.spec.ts @@ -1,5 +1,17 @@ import {cyChannelsFormBackButton, cyChannelsChatPluginList} from 'handles'; +// declare global { +// namespace Cypress { +// interface Chainable { +// createChatPluginConversation(): Chainable; +// editContactDetails(): Chainable; +// connectChatPluginConnector(): Chainable; +// editDisplayName(): Chainable; +// listConversationsForContact(): Chainable; +// } +// } +// } + describe('Connect chatplugin channel', () => { it('Connect chatplugin channel', () => { cy.visit('/control-center/connectors'); diff --git a/tsconfig.json b/tsconfig.json index 810079195d..eceabc70ad 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,6 +7,6 @@ "./frontend/**/*", "./lib/typescript/**/*", ], - "types": ["node", "@testing-library/jest-dom", "jest"], + "types": ["node", "@testing-library/jest-dom", "jest", "./integration/commands/index.ts"], "rootDirs": ["."] } From d55ed42494ab9295b57e226cab50d6454fce6e8f Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Mon, 8 Aug 2022 19:58:06 +0200 Subject: [PATCH 29/32] build fix --- .../chat-plugin/websocket_test.spec.ts | 22 +++++++++---------- integration/ui/connect_chatplugin.spec.ts | 22 +++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/integration/chat-plugin/websocket_test.spec.ts b/integration/chat-plugin/websocket_test.spec.ts index cc8ffb3a32..5415747cec 100644 --- a/integration/chat-plugin/websocket_test.spec.ts +++ b/integration/chat-plugin/websocket_test.spec.ts @@ -1,16 +1,16 @@ import {cyChatPluginMessageList} from 'chat-plugin-handles'; -// declare global { -// namespace Cypress { -// interface Chainable { -// createChatPluginConversation(): Chainable; -// editContactDetails(): Chainable; -// connectChatPluginConnector(): Chainable; -// editDisplayName(): Chainable; -// listConversationsForContact(): Chainable; -// } -// } -// } +declare global { + namespace Cypress { + interface Chainable { + createChatPluginConversation(): Chainable; + editContactDetails(): Chainable; + connectChatPluginConnector(): Chainable; + editDisplayName(): Chainable; + listConversationsForContact(): Chainable; + } + } +} describe('Websocket test', () => { it('Send message from Inbox to Chatplugin and assert Websocket is working', () => { diff --git a/integration/ui/connect_chatplugin.spec.ts b/integration/ui/connect_chatplugin.spec.ts index 9dc2e09d7b..ab7a23c2f1 100644 --- a/integration/ui/connect_chatplugin.spec.ts +++ b/integration/ui/connect_chatplugin.spec.ts @@ -1,16 +1,16 @@ import {cyChannelsFormBackButton, cyChannelsChatPluginList} from 'handles'; -// declare global { -// namespace Cypress { -// interface Chainable { -// createChatPluginConversation(): Chainable; -// editContactDetails(): Chainable; -// connectChatPluginConnector(): Chainable; -// editDisplayName(): Chainable; -// listConversationsForContact(): Chainable; -// } -// } -// } +declare global { + namespace Cypress { + interface Chainable { + createChatPluginConversation(): Chainable; + editContactDetails(): Chainable; + connectChatPluginConnector(): Chainable; + editDisplayName(): Chainable; + listConversationsForContact(): Chainable; + } + } +} describe('Connect chatplugin channel', () => { it('Connect chatplugin channel', () => { From ba2a0578692769d0dd951310b99157758d76babc Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Tue, 9 Aug 2022 16:15:33 +0200 Subject: [PATCH 30/32] lint --- lib/typescript/components/alerts/SettingsModal/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/typescript/components/alerts/SettingsModal/index.tsx b/lib/typescript/components/alerts/SettingsModal/index.tsx index 18abe84542..d8faac4eae 100644 --- a/lib/typescript/components/alerts/SettingsModal/index.tsx +++ b/lib/typescript/components/alerts/SettingsModal/index.tsx @@ -36,7 +36,8 @@ export const SettingsModal = (props: SettingsModalProps) => { contentLabel={title} isOpen={true} shouldCloseOnOverlayClick={true} - onRequestClose={close}> + onRequestClose={close} + >
{Icon ? Icon : ''} From a9842a788bd31f2496684b0975ec606c98c4f4bd Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Tue, 9 Aug 2022 16:51:52 +0200 Subject: [PATCH 31/32] linting fix --- .../components/alerts/SettingsModal/index.tsx | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/lib/typescript/components/alerts/SettingsModal/index.tsx b/lib/typescript/components/alerts/SettingsModal/index.tsx index d8faac4eae..bc9b0faf1a 100644 --- a/lib/typescript/components/alerts/SettingsModal/index.tsx +++ b/lib/typescript/components/alerts/SettingsModal/index.tsx @@ -13,21 +13,10 @@ type SettingsModalProps = { Icon?: React.ReactElement | null; headerClassName?: string; style?: CSSProperties; - dataCyCloseButton?: string; }; export const SettingsModal = (props: SettingsModalProps) => { - const { - close, - title, - children, - headerClassName, - wrapperClassName, - style, - containerClassName, - Icon, - dataCyCloseButton, - } = props; + const {close, title, children, headerClassName, wrapperClassName, style, containerClassName, Icon} = props; return ( Date: Tue, 9 Aug 2022 17:20:33 +0200 Subject: [PATCH 32/32] fix rebase --- .../components/alerts/SettingsModal/index.tsx | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/typescript/components/alerts/SettingsModal/index.tsx b/lib/typescript/components/alerts/SettingsModal/index.tsx index bc9b0faf1a..6418f63ff3 100644 --- a/lib/typescript/components/alerts/SettingsModal/index.tsx +++ b/lib/typescript/components/alerts/SettingsModal/index.tsx @@ -13,10 +13,21 @@ type SettingsModalProps = { Icon?: React.ReactElement | null; headerClassName?: string; style?: CSSProperties; + dataCyCloseButton?: string; }; export const SettingsModal = (props: SettingsModalProps) => { - const {close, title, children, headerClassName, wrapperClassName, style, containerClassName, Icon} = props; + const { + close, + title, + children, + headerClassName, + wrapperClassName, + style, + containerClassName, + Icon, + dataCyCloseButton, + } = props; return ( { >
{Icon ? Icon : ''} - + {children}