Skip to content

Commit

Permalink
Merge pull request #1010 from acm-ucr/shahdivyank/judges_bug
Browse files Browse the repository at this point in the history
Convert to Lowercase in Tags when Printing Text
  • Loading branch information
shahdivyank authored Jan 4, 2024
2 parents 613eda6 + 4e50d6a commit 74e1329
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 5 additions & 5 deletions cypress/component/admin/Tag.cy.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe("Tag", () => {
const text = "Accept";

cy.mount(<Tag color={color} text={text} onClick={onClick} />);
cy.get('[data-cy="Accept-tag"]').contains("Accept");
cy.get('[data-cy="Accept-tag"]').contains("accept");
cy.get('[data-cy="Accept-tag"]').should(
"have.class",
"bg-hackathon-tags-green-bg",
Expand All @@ -26,7 +26,7 @@ describe("Tag", () => {
const text = "Pending";

cy.mount(<Tag color={color} text={text} onClick={onClick} />);
cy.get('[data-cy="Pending-tag"]').contains("Pending");
cy.get('[data-cy="Pending-tag"]').contains("pending");
cy.get('[data-cy="Pending-tag"]').should(
"have.class",
"bg-hackathon-tags-yellow-bg",
Expand All @@ -44,7 +44,7 @@ describe("Tag", () => {
const text = "Reject";

cy.mount(<Tag color={color} text={text} onClick={onClick} />);
cy.get('[data-cy="Reject-tag"]').contains("Reject");
cy.get('[data-cy="Reject-tag"]').contains("reject");
cy.get('[data-cy="Reject-tag"]').should(
"have.class",
"bg-hackathon-tags-red-bg",
Expand All @@ -69,7 +69,7 @@ describe("Tag", () => {
classes="border-2 border-black"
/>
);
cy.get('[data-cy="Accept-tag"]').contains("Accept");
cy.get('[data-cy="Accept-tag"]').contains("accept");
cy.get('[data-cy="Accept-tag"]').should(
"have.class",
"bg-hackathon-tags-green-bg",
Expand All @@ -88,7 +88,7 @@ describe("Tag", () => {
const text = "Accept";

cy.mount(<Tag color={color} text={text} />);
cy.get('[data-cy="Accept-tag"]').contains("Accept");
cy.get('[data-cy="Accept-tag"]').contains("accept");
cy.get('[data-cy="Accept-tag"]').should(
"have.class",
"bg-hackathon-tags-green-bg",
Expand Down
4 changes: 3 additions & 1 deletion src/components/dynamic/admin/Tag.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const Tag = ({ color, text, onClick, classes, statuses }) => {
console.log(text);

return (
<div
data-cy={`${text}-tag`}
Expand All @@ -7,7 +9,7 @@ const Tag = ({ color, text, onClick, classes, statuses }) => {
} whitespace-nowrap px-2 py-0.5 rounded text-xs md:text-sm w-fit m-0`}
onClick={onClick}
>
{isNaN(text) ? text : statuses[text]}
{isNaN(text) ? text.toLowerCase() : statuses[text]}
</div>
);
};
Expand Down

0 comments on commit 74e1329

Please sign in to comment.