Skip to content

Commit

Permalink
Merge pull request #438 from Cognigy/bug/71598-fix-failing-test-pipeline
Browse files Browse the repository at this point in the history
Fix failing tests in the pipeline
  • Loading branch information
sushmi21 authored Jul 5, 2024
2 parents 8677c7b + 3aacfe8 commit 83e497a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions cypress/e2e/disableLocalStorage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { SinonSpy } from "cypress/types/sinon";

describe("disableLocalStorage", () => {
it("does not try to read from localStorage when disableLocalStorage flag is set", () => {
cy.visitWebchat();

cy.window().then(window => {
cy.spy(window.localStorage, "getItem").as("lsGetItemSpy");
cy.spy(window.localStorage, "setItem").as("lsSetItemSpy");
})

cy.visitWebchat();

cy.initWebchat({
settings: {
embeddingConfiguration: {
Expand Down Expand Up @@ -36,14 +36,14 @@ describe("disableLocalStorage", () => {
});

it("does not try to read either from localStorage or sessionStorage when disableLocalStorage and useSessionStorage flags are set", () => {
cy.visitWebchat();

cy.window().then(window => {
cy.spy(window.localStorage, "getItem").as("lsGetItemSpy");
cy.spy(window.localStorage, "setItem").as("lsSetItemSpy");
cy.spy(window.sessionStorage, "getItem").as("ssGetItemSpy");
cy.spy(window.sessionStorage, "setItem").as("ssSetItemSpy");
})
});

cy.visitWebchat();

cy.initWebchat({
settings: {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/message-colors.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ describe('Message Color Variants', () => {
cy.receiveMessageFixture('buttons');

cy.get('.webchat-buttons-template-root .chat-bubble').should('have.css', 'background', 'rgb(232, 235, 255) none repeat scroll 0% 0% / auto padding-box border-box');
cy.get('.webchat-buttons-template-root').should('have.css', 'color', 'rgb(255, 255, 255)');
cy.get('.webchat-buttons-template-root .chat-bubble').should('have.css', 'color', 'rgba(26, 26, 26, 0.95)');
});

it('renders a "quick reply"', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/webchat-ui/utils/sourceMapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { IWebchatSettings, TSourceColor } from "../../common/interfaces/webchat-

export function getSourceBackgroundColor(mappedValue: TSourceColor, colors: IWebchatSettings["colors"]): string | null {
if (mappedValue === "bot") {
return colors.botMessageColor;
return colors.botMessageColor || "#FFFFFF";
} else if (mappedValue === "user") {
return colors.userMessageColor;
return colors.userMessageColor || "#E8EBFF";
} else {
return null;
}
Expand Down

0 comments on commit 83e497a

Please sign in to comment.