Skip to content

Commit

Permalink
Merge branch 'main' into snyk-upgrade-858a01a0696777827e13afed1ad4daff
Browse files Browse the repository at this point in the history
  • Loading branch information
sushmi21 committed Sep 6, 2024
2 parents b089156 + 1f756b9 commit 065bbac
Show file tree
Hide file tree
Showing 33 changed files with 464 additions and 268 deletions.
56 changes: 42 additions & 14 deletions OSS_LICENSES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Created on 07-08-2024 at 16:11:49
Created on 29-08-2024 at 11:10:23

{
"@babel/code-frame@7.24.2": {
Expand Down Expand Up @@ -63,19 +63,19 @@ Created on 07-08-2024 at 16:11:49
"licenseFile": "node_modules/@braintree/sanitize-url/LICENSE",
"copyright": "Copyright (c) 2017 Braintree"
},
"@cognigy/chat-components@0.29.0": {
"@cognigy/chat-components@0.33.1": {
"licenses": "MIT*",
"licenseFile": "node_modules/@cognigy/chat-components/LICENSE",
"copyright": "Copyright (c) 2024 Cognigy GmbH"
},
"@cognigy/socket-client@5.0.0-beta.17": {
"@cognigy/socket-client@5.0.0-beta.20": {
"licenses": "MIT*",
"publisher": "Robin Schuster",
"email": "r.schuster@cognigy.com",
"licenseFile": "node_modules/@cognigy/socket-client/LICENSE",
"copyright": "Copyright (c) 2019 Cognigy GmbH"
},
"@cognigy/webchat@3.0.0": {
"@cognigy/webchat@3.3.0": {
"licenses": "MIT*",
"publisher": "Cognigy GmbH",
"email": "info@cognigy.com",
Expand Down Expand Up @@ -213,6 +213,27 @@ Created on 07-08-2024 at 16:11:49
"licenseFile": "node_modules/@emotion/react/node_modules/@emotion/weak-memoize/LICENSE",
"copyright": "Copyright (c) Emotion team and other contributors"
},
"@floating-ui/core@1.6.7": {
"licenses": "MIT",
"repository": "https://github.com/floating-ui/floating-ui",
"publisher": "atomiks",
"licenseFile": "node_modules/@floating-ui/core/LICENSE",
"copyright": "Copyright (c) 2021-present Floating UI contributors"
},
"@floating-ui/dom@1.6.10": {
"licenses": "MIT",
"repository": "https://github.com/floating-ui/floating-ui",
"publisher": "atomiks",
"licenseFile": "node_modules/@floating-ui/dom/LICENSE",
"copyright": "Copyright (c) 2021-present Floating UI contributors"
},
"@floating-ui/utils@0.2.7": {
"licenses": "MIT",
"repository": "https://github.com/floating-ui/floating-ui",
"publisher": "atomiks",
"licenseFile": "node_modules/@floating-ui/utils/LICENSE",
"copyright": "Copyright (c) 2021-present Floating UI contributors"
},
"@fontsource/figtree@5.0.19": {
"licenses": "OFL-1.1",
"repository": "https://github.com/fontsource/font-files",
Expand All @@ -228,7 +249,7 @@ Created on 07-08-2024 at 16:11:49
"licenseFile": "node_modules/@reduxjs/toolkit/LICENSE",
"copyright": "Copyright (c) 2018 Mark Erikson"
},
"@socket.io/component-emitter@3.1.0": {
"@socket.io/component-emitter@3.1.2": {
"licenses": "MIT",
"repository": "https://github.com/socketio/emitter",
"licenseFile": "node_modules/@socket.io/component-emitter/LICENSE",
Expand Down Expand Up @@ -457,7 +478,7 @@ Created on 07-08-2024 at 16:11:49
"licenseFile": "node_modules/aws4/LICENSE",
"copyright": "Copyright 2013 Michael Hart (michael.hart.au@gmail.com)"
},
"axios@1.6.4": {
"axios@1.7.4": {
"licenses": "MIT",
"repository": "https://github.com/axios/axios",
"publisher": "Matt Zabriskie",
Expand Down Expand Up @@ -906,17 +927,17 @@ Created on 07-08-2024 at 16:11:49
"licenseFile": "node_modules/end-of-stream/LICENSE",
"copyright": "Copyright (c) 2014 Mathias Buus"
},
"engine.io-client@6.5.3": {
"engine.io-client@6.5.4": {
"licenses": "MIT",
"repository": "https://github.com/socketio/engine.io-client",
"licenseFile": "node_modules/engine.io-client/LICENSE",
"copyright": "Copyright (c) 2014-2015 Automattic <dev@cloudup.com>"
},
"engine.io-parser@5.2.2": {
"engine.io-parser@5.2.3": {
"licenses": "MIT",
"repository": "https://github.com/socketio/engine.io-parser",
"repository": "https://github.com/socketio/socket.io",
"licenseFile": "node_modules/engine.io-parser/LICENSE",
"copyright": "Copyright (c) 2016 Guillermo Rauch (@rauchg)"
"copyright": "Copyright (c) 2014-present Guillermo Rauch and Socket.IO contributors"
},
"enquirer@2.4.1": {
"licenses": "MIT",
Expand Down Expand Up @@ -1927,7 +1948,7 @@ Created on 07-08-2024 at 16:11:49
"licenseFile": "node_modules/qs/LICENSE.md",
"copyright": "Copyright (c) 2014, Nathan LaFreniere and other [contributors](https://github.com/ljharb/qs/graphs/contributors). All rights reserved."
},
"qs@6.12.0": {
"qs@6.13.0": {
"licenses": "BSD-3-Clause",
"repository": "https://github.com/ljharb/qs",
"licenseFile": "node_modules/url/node_modules/qs/LICENSE.md",
Expand Down Expand Up @@ -2014,6 +2035,13 @@ Created on 07-08-2024 at 16:11:49
"licenseFile": "node_modules/react-textarea-autosize/LICENSE",
"copyright": "Copyright (c) 2013 Andrey Popp"
},
"react-tooltip@5.28.0": {
"licenses": "MIT",
"repository": "https://github.com/ReactTooltip/react-tooltip",
"publisher": "ReactTooltip",
"licenseFile": "node_modules/react-tooltip/LICENSE",
"copyright": "Copyright (c) 2022 ReactTooltip Team Github"
},
"react-transition-group@4.4.5": {
"licenses": "BSD-3-Clause",
"repository": "https://github.com/reactjs/react-transition-group",
Expand Down Expand Up @@ -2260,7 +2288,7 @@ Created on 07-08-2024 at 16:11:49
"licenseFile": "node_modules/slide/LICENSE",
"copyright": "Copyright (c) Isaac Z. Schlueter"
},
"socket.io-client@4.7.2": {
"socket.io-client@4.7.5": {
"licenses": "MIT",
"repository": "https://github.com/socketio/socket.io-client",
"licenseFile": "node_modules/socket.io-client/LICENSE",
Expand Down Expand Up @@ -2656,14 +2684,14 @@ Created on 07-08-2024 at 16:11:49
"licenseFile": "node_modules/wrappy/LICENSE",
"copyright": "Copyright (c) Isaac Z. Schlueter and Contributors"
},
"ws@8.11.0": {
"ws@8.17.1": {
"licenses": "MIT",
"repository": "https://github.com/websockets/ws",
"publisher": "Einar Otto Stangvik",
"email": "einaros@gmail.com",
"url": "http://2x.io",
"licenseFile": "node_modules/ws/LICENSE",
"copyright": "Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>"
"copyright": "Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>. Copyright (c) 2013 Arnout Kazemier and contributors. Copyright (c) 2016 Luigi Pinca and contributors"
},
"xmlhttprequest-ssl@2.0.0": {
"licenses": "MIT",
Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ You need an installed version of `Node.js` to build your Webchat. Clone this rep
For development purposes, you can utilize `npm run dev`. This command spawns an HTTP server on port 8080, showcasing the current form of the webchat directly from the source code. It automatically reloads upon updating source files, simplifying the development process.
It automatically reloads when you make changes, streamlining the development process.

## Compatibility Builds

The `npm run bundle` command generates bundle files for the Webchat itself and basic Webchat plugins. Additionally, it produces a second version of each bundle ending in `.legacy.js`. These builds maintain the same feature set as the regular ones but are converted into an older JavaScript standard, enhancing compatibility for older browsers that lack support for modern JavaScript features, such as Internet Explorer 11. When you run the command `npm run bundle`, it creates bundle files for the Webchat along with some basic Webchat plugins. This command also produces a second version of each bundle, which has `.legacy.js` at the end of its name. These builds have the same features as the regular ones but are converted into an older JavaScript standard. This enhances compatibility for older browsers that don't support modern JavaScript features, such as Internet Explorer 11.

## Migration Guide

If you are already using Webchat 2 and want to migrate to Webchat v3, please follow the [migration guide](https://docs.cognigy.com/webchat/migration/) here.
Expand Down
6 changes: 6 additions & 0 deletions cypress/e2e/engagement.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ describe("Engagement Message", () => {
unreadMessages: {
enablePreview: false,
},
homeScreen: {
enabled: false,
}
},
});
cy.get("[data-cognigy-webchat-toggle]").click().click();
Expand Down Expand Up @@ -137,6 +140,9 @@ describe("Engagement Message", () => {
unreadMessages: {
enablePreview: false,
},
homeScreen: {
enabled: false,
}
},
});
cy.wait(500);
Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/homeScreen.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ describe('Home Screen', () => {
{
type: "phone_number",
title: "Phone number starter",
payload: "123456789"
},
]
}
Expand All @@ -263,8 +264,8 @@ describe('Home Screen', () => {
});
cy.openWebchat();
cy.get('button').contains('Postback starter');
cy.get('button').contains('Web URL starter');
cy.get('button').contains('Phone number starter');
cy.get('a').contains('Web URL starter');
cy.get('a').contains('Phone number starter');
});

it('has postback buttons that starts a conversation when clicked', () => {
Expand All @@ -291,7 +292,7 @@ describe('Home Screen', () => {
cy.get('.webchat-message-row.user .chat-bubble', { timeout: 100 }).contains('Postback starter');
});

it('has web url button with correct role when configured', () => {
it('has web url button with correct aria-label when configured', () => {
cy.initMockWebchat({
settings: {
homeScreen: {
Expand All @@ -311,7 +312,6 @@ describe('Home Screen', () => {
}
});
cy.openWebchat();
cy.get('.webchat-homescreen-button').should('have.attr', 'role', 'link');
cy.get('.webchat-homescreen-button').should('have.attr', 'aria-label', 'Web URL starter. Opens in new tab');
});

Expand Down
10 changes: 0 additions & 10 deletions cypress/e2e/messages/audio.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,5 @@ describe("Message with Audio", () => {
cy.withMessageFixture('audio', () => {
cy.get(".webchat-message-row .webchat-media-template-audio");
})
})

it("should have sr-only default alternate text for audio", () => {
cy.withMessageFixture('audio', () => {
cy
.get(".webchat-message-row .webchat-media-template-audio span")
.contains("Attachment Audio")
.should("not.be.visible");
})
})

})
2 changes: 1 addition & 1 deletion cypress/e2e/messages/downloadableImage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe("Message with Downloadable Image", () => {
it("should render download button", () => {
cy.withMessageFixture('downloadableImage', () => {
cy
.get("button").contains("Download");
.get(".webchat-message-row a").contains("Download");
})
});
})
11 changes: 5 additions & 6 deletions cypress/e2e/messages/image.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe("Message with Image", { retries: 3 }, () => {

it("should render image", () => {
cy.withMessageFixture("image", () => {
cy.get(".webchat-message-row > div > img").should("be.visible");
cy.get(".webchat-message-row img").should("be.visible");
});
});

Expand All @@ -20,15 +20,14 @@ describe("Message with Image", { retries: 3 }, () => {

it("should have alt attibute", () => {
cy.withMessageFixture("image", () => {
cy.get(".webchat-message-row > div > img")
.should("have.attr", "alt")
.and("match", /Attachment Image/);
cy.get(".webchat-media-template-image img")
.should("have.attr", "alt", "Attachment Image")
});
});

it("should render the image in a fixed aspect ratio", () => {
cy.withMessageFixture("image", () => {
cy.get(".webchat-media-template-image > img")
cy.get(".webchat-media-template-image img")
.should("be.visible")
.then(element => {
const imageRatio = (element.innerWidth() / element.innerHeight()).toFixed(1);
Expand All @@ -51,7 +50,7 @@ describe("Message with Image", { retries: 3 }, () => {
cy.startConversation();

cy.withMessageFixture("image", () => {
cy.get(".webchat-media-template-image > img")
cy.get(".webchat-media-template-image img")
.should("be.visible")
.then(element => {
expect(element.innerHeight().toFixed()).to.equal(
Expand Down
8 changes: 0 additions & 8 deletions cypress/e2e/messages/video.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,4 @@ describe("Message with Video", () => {
cy.get(".webchat-message-row .webchat-media-template-video");
})
})

it("should have sr-only default alternate text for video", () => {
cy.withMessageFixture('video', () => {
cy.get(".webchat-message-row .webchat-media-template-video .sr-only")
.contains("Attachment Video")
.should("not.be.visible");
})
})
})
Loading

0 comments on commit 065bbac

Please sign in to comment.