diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 0a78207153..0e90783ce7 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -21,7 +21,7 @@ env: jobs: Code-Quality-Checks: - name: Performs linting, formatting, type-checking + name: Performs linting, formatting, type-checking, checking for different source and target branch runs-on: ubuntu-latest steps: - name: Checkout the Repository @@ -66,6 +66,13 @@ jobs: chmod +x .github/workflows/compare_translations.py python .github/workflows/compare_translations.py --directory public/locales + - name: Check if the source and target branches are different + if: ${{ github.event.pull_request.base.ref == github.event.pull_request.head.ref }} + run: | + echo "Source Branch ${{ github.event.pull_request.head.ref }}" + echo "Target Branch ${{ github.event.pull_request.base.ref }}" + echo "Error: Source and Target Branches are the same. Please ensure they are different." + exit 1 Check-Changed-Files: name: File count, sensitive files and branch check diff --git a/src/assets/svgs/pinUserCardFilled.svg b/src/assets/svgs/pinUserCardFilled.svg deleted file mode 100644 index 8ba5f2ec7f..0000000000 --- a/src/assets/svgs/pinUserCardFilled.svg +++ /dev/null @@ -1,4 +0,0 @@ - diff --git a/src/components/UserPortal/PostCard/PostCard.test.tsx b/src/components/UserPortal/PostCard/PostCard.test.tsx index ba1a097b5e..4a00cf3a5a 100644 --- a/src/components/UserPortal/PostCard/PostCard.test.tsx +++ b/src/components/UserPortal/PostCard/PostCard.test.tsx @@ -29,7 +29,7 @@ describe('PostCard compoenent', () => { creator: { firstName: 'John', lastName: 'Doe', - image: '', + image: 'https://example.com/authorimage.jpg', id: '1', }, image: 'https://example.com/image.jpg', @@ -92,7 +92,7 @@ describe('PostCard compoenent', () => { , ); - const Image = screen.getByRole('img'); + const Image = screen.getByRole('img', { name: 'postImg' }); expect(Image).toBeInTheDocument(); expect(Image).toHaveAttribute('src', postWithImage.image); }); @@ -109,7 +109,8 @@ describe('PostCard compoenent', () => { , ); - const authorProfile = screen.getByRole('button', { name: 'profileImg' }); - expect(authorProfile).toBeInTheDocument(); + const imgElement = screen.getByRole('img', { name: 'profileImg' }); + expect(imgElement).toBeInTheDocument(); + expect(imgElement).toHaveAttribute('src', postWithImage.creator.image); }); }); diff --git a/src/components/UserPortal/PostCard/PostCard.tsx b/src/components/UserPortal/PostCard/PostCard.tsx index a6462f2793..343c94512b 100644 --- a/src/components/UserPortal/PostCard/PostCard.tsx +++ b/src/components/UserPortal/PostCard/PostCard.tsx @@ -97,8 +97,13 @@ export default function postCard(props: InterfacePostCardProps): JSX.Element { )} - {/* image */} - {props.image && } + {props.image && ( + + )} {!props.image &&
}