Skip to content

Commit

Permalink
fix: Fix int test
Browse files Browse the repository at this point in the history
  • Loading branch information
tjtanjin committed Oct 13, 2024
1 parent 5b8d3ef commit 9b93706
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 53 deletions.
10 changes: 6 additions & 4 deletions cypress/e2e/tests.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,15 @@ describe("Chat Bot Test Suite", () => {
});

it("Toggles notifications", () => {
cy.get(".rcb-notification-icon-on").click();
cy.get(".rcb-notification-icon-off").should("be.visible");
cy.get("[data-testid='rcb-notification-icon-svg']").click();
cy.wait(100);
cy.get("[data-testid='rcb-notification-icon-svg']").should('have.css', 'fill', 'rgb(232, 234, 237)');
});

it("Toggles audio", () => {
cy.get(".rcb-audio-icon-off").click();
cy.get(".rcb-audio-icon-on").should("be.visible");
cy.get("[data-testid='rcb-audio-icon-svg']").click();
cy.wait(100);
cy.get("[data-testid='rcb-audio-icon-svg']").should('have.css', 'fill', 'rgb(252, 236, 61)');
});

it("Toggles voice", () => {
Expand Down
5 changes: 4 additions & 1 deletion src/components/Buttons/AudioButton/AudioButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ const AudioButton = () => {
return (
IconComponent &&
<span className="rcb-audio-icon" data-testid="rcb-audio-icon">
<IconComponent style={audioToggledOn ? audioIconStyle : audioIconDisabledStyle}/>
<IconComponent
style={audioToggledOn ? audioIconStyle : audioIconDisabledStyle}
data-testid="rcb-audio-icon-svg"
/>
</span>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ const NotificationButton = () => {
return (
IconComponent &&
<span className="rcb-notification-icon" data-testid="rcb-notification-icon">
<IconComponent style={notificationsToggledOn? notificationIconStyle : notificationIconDisabledStyle}/>
<IconComponent
style={notificationsToggledOn? notificationIconStyle : notificationIconDisabledStyle}
data-testid="rcb-notification-icon-svg"
/>
</span>
)
}
Expand Down
47 changes: 0 additions & 47 deletions src/components/ChatBotHeader/ChatBotHeader.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,51 +22,4 @@
height: 30px;
border-radius: 50%;
margin-right: 12px;
}

/* Notification & Audio Icon */

.rcb-notification-icon-on,
.rcb-notification-icon-off,
.rcb-audio-icon-on,
.rcb-audio-icon-off {
position: relative;
display: inline-block;
background-size: cover;
width: 30px;
height: 30px;
border: none;
cursor: pointer;
margin-left: 5px;
}

.rcb-notification-icon-off,
.rcb-audio-icon-off {
filter: grayscale(100%);
}

.rcb-notification-icon-on::after,
.rcb-notification-icon-off::after,
.rcb-audio-icon-on::after,
.rcb-audio-icon-off::after {
content: "";
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 0;
height: 0;
background-color: rgba(0, 0, 0, 0.1);
border-radius: 50%;
opacity: 0;
transition: width 0.2s ease-out, height 0.2s ease-out, opacity 0.2s ease-out;
}

.rcb-notification-icon-on:hover::after,
.rcb-notification-icon-off:hover::after,
.rcb-audio-icon-on:hover::after,
.rcb-audio-icon-off:hover::after {
width: 130%;
height: 130%;
opacity: 1;
}

0 comments on commit 9b93706

Please sign in to comment.