) {
);
}
-function CardFooter({ className, ...props }: React.ComponentProps<'div'>) {
+CardContent.propTypes = {
+ className: PropTypes.string,
+};
+
+interface CardFooterProps extends React.HTMLAttributes
{
+ className?: string;
+}
+
+function CardFooter({ className, ...props }: CardFooterProps) {
return (
) {
);
}
+CardFooter.propTypes = {
+ className: PropTypes.string,
+};
+
export {
Card,
CardHeader,
From 467628e654a0c4d6f855a2b5584edc04775de81c Mon Sep 17 00:00:00 2001
From: Idan Levi <29idan29@gmail.com>
Date: Fri, 6 Jun 2025 16:53:05 +0300
Subject: [PATCH 08/10] installing prop types for the use of shadcn card
element
---
package.json | 2 ++
yarn.lock | 9 +++++++++
2 files changed, 11 insertions(+)
diff --git a/package.json b/package.json
index 7fc4ea15b..bf82e850a 100644
--- a/package.json
+++ b/package.json
@@ -49,6 +49,7 @@
"next-sitemap": "^4.2.3",
"next-themes": "^0.4.4",
"node-ical": "0.20.1",
+ "prop-types": "^15.8.1",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-syntax-highlighter": "^15.6.1",
@@ -74,6 +75,7 @@
"@types/file-saver": "^2.0.7",
"@types/js-yaml": "^4.0.5",
"@types/node": "^22.10.10",
+ "@types/prop-types": "^15",
"@types/react": "18.3.5",
"@types/react-syntax-highlighter": "^15.5.13",
"@types/react-text-truncate": "^0.19.0",
diff --git a/yarn.lock b/yarn.lock
index b434e8767..ed33b8eb9 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3802,6 +3802,13 @@ __metadata:
languageName: node
linkType: hard
+"@types/prop-types@npm:^15":
+ version: 15.7.14
+ resolution: "@types/prop-types@npm:15.7.14"
+ checksum: 10c0/1ec775160bfab90b67a782d735952158c7e702ca4502968aa82565bd8e452c2de8601c8dfe349733073c31179116cf7340710160d3836aa8a1ef76d1532893b1
+ languageName: node
+ linkType: hard
+
"@types/react-syntax-highlighter@npm:^15.5.13":
version: 15.5.13
resolution: "@types/react-syntax-highlighter@npm:15.5.13"
@@ -8557,6 +8564,7 @@ __metadata:
"@types/js-yaml": "npm:^4.0.5"
"@types/jsonpath": "npm:^0.2.4"
"@types/node": "npm:^22.10.10"
+ "@types/prop-types": "npm:^15"
"@types/react": "npm:18.3.5"
"@types/react-syntax-highlighter": "npm:^15.5.13"
"@types/react-text-truncate": "npm:^0.19.0"
@@ -8600,6 +8608,7 @@ __metadata:
nyc: "npm:^17.1.0"
postcss: "npm:^8.4.41"
prettier: "npm:3.3.3"
+ prop-types: "npm:^15.8.1"
react: "npm:18.3.1"
react-dom: "npm:18.3.1"
react-syntax-highlighter: "npm:^15.6.1"
From 44c8cc35d0eb971b9a0ccb565da0f76415135785 Mon Sep 17 00:00:00 2001
From: Idan Levi <29idan29@gmail.com>
Date: Fri, 6 Jun 2025 17:01:17 +0300
Subject: [PATCH 09/10] Revert "installing prop types for the use of shadcn
card element"
This reverts commit 467628e654a0c4d6f855a2b5584edc04775de81c.
---
package.json | 2 --
yarn.lock | 9 ---------
2 files changed, 11 deletions(-)
diff --git a/package.json b/package.json
index bf82e850a..7fc4ea15b 100644
--- a/package.json
+++ b/package.json
@@ -49,7 +49,6 @@
"next-sitemap": "^4.2.3",
"next-themes": "^0.4.4",
"node-ical": "0.20.1",
- "prop-types": "^15.8.1",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-syntax-highlighter": "^15.6.1",
@@ -75,7 +74,6 @@
"@types/file-saver": "^2.0.7",
"@types/js-yaml": "^4.0.5",
"@types/node": "^22.10.10",
- "@types/prop-types": "^15",
"@types/react": "18.3.5",
"@types/react-syntax-highlighter": "^15.5.13",
"@types/react-text-truncate": "^0.19.0",
diff --git a/yarn.lock b/yarn.lock
index ed33b8eb9..b434e8767 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3802,13 +3802,6 @@ __metadata:
languageName: node
linkType: hard
-"@types/prop-types@npm:^15":
- version: 15.7.14
- resolution: "@types/prop-types@npm:15.7.14"
- checksum: 10c0/1ec775160bfab90b67a782d735952158c7e702ca4502968aa82565bd8e452c2de8601c8dfe349733073c31179116cf7340710160d3836aa8a1ef76d1532893b1
- languageName: node
- linkType: hard
-
"@types/react-syntax-highlighter@npm:^15.5.13":
version: 15.5.13
resolution: "@types/react-syntax-highlighter@npm:15.5.13"
@@ -8564,7 +8557,6 @@ __metadata:
"@types/js-yaml": "npm:^4.0.5"
"@types/jsonpath": "npm:^0.2.4"
"@types/node": "npm:^22.10.10"
- "@types/prop-types": "npm:^15"
"@types/react": "npm:18.3.5"
"@types/react-syntax-highlighter": "npm:^15.5.13"
"@types/react-text-truncate": "npm:^0.19.0"
@@ -8608,7 +8600,6 @@ __metadata:
nyc: "npm:^17.1.0"
postcss: "npm:^8.4.41"
prettier: "npm:3.3.3"
- prop-types: "npm:^15.8.1"
react: "npm:18.3.1"
react-dom: "npm:18.3.1"
react-syntax-highlighter: "npm:^15.6.1"
From ab5ec5c2beadd0af78baf4c03e40551008d44e57 Mon Sep 17 00:00:00 2001
From: Idan Levi <29idan29@gmail.com>
Date: Fri, 6 Jun 2025 17:03:39 +0300
Subject: [PATCH 10/10] adding card test file for full test coverage
---
cypress/components/ui/card.cy.tsx | 36 +++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
create mode 100644 cypress/components/ui/card.cy.tsx
diff --git a/cypress/components/ui/card.cy.tsx b/cypress/components/ui/card.cy.tsx
new file mode 100644
index 000000000..d9cfb42d6
--- /dev/null
+++ b/cypress/components/ui/card.cy.tsx
@@ -0,0 +1,36 @@
+// card.cy.tsx
+
+import React from 'react';
+import {
+ Card,
+ CardHeader,
+ CardFooter,
+ CardTitle,
+ CardAction,
+ CardDescription,
+ CardContent,
+} from '@/components/ui/card';
+
+describe('Card Component', () => {
+ it('renders all Card subcomponents correctly', () => {
+ cy.mount(
+
+
+ Test Title
+ Action
+
+ Description here
+ Content goes here
+ Footer
+ ,
+ );
+
+ cy.get('[data-slot="card"]').should('exist');
+ cy.get('[data-slot="card-header"]').should('exist');
+ cy.get('[data-slot="card-title"]').contains('Test Title');
+ cy.get('[data-slot="card-action"]').contains('Action');
+ cy.get('[data-slot="card-description"]').contains('Description here');
+ cy.get('[data-slot="card-content"]').contains('Content goes here');
+ cy.get('[data-slot="card-footer"]').contains('Footer');
+ });
+});