Skip to content

Commit

Permalink
Fix tests related to colors
Browse files Browse the repository at this point in the history
  • Loading branch information
sushmi21 committed Jul 5, 2024
1 parent effc5e1 commit 41febf2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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 41febf2

Please sign in to comment.