Skip to content

Commit

Permalink
feat(image-upload): implement image upload functionality (#129)
Browse files Browse the repository at this point in the history
- implement image upload functionality using cloudinary

[Delivers #128]
  • Loading branch information
jkarenzi authored Jul 2, 2024
1 parent 8f7618f commit 60a10d5
Show file tree
Hide file tree
Showing 11 changed files with 361 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/workflow_for_ecomm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,4 @@ jobs:
VALIDATE_MOMO: ${{ secrets.VALIDATE_MOMO }}
API_KEY_URL: ${{ secrets.API_KEY_URL }}
SUBSCRIPTION_KEY: ${{ secrets.SUBSCRIPTION_KEY }}
DEFAULT_PROFILE_URL: ${{ secrets.DEFAULT_PROFILE_URL }}
207 changes: 205 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"bcryptjs": "^2.4.3",
"check-code-coverage": "^1.10.5",
"class-validator": "^0.14.1",
"cloudinary": "^2.0.3",
"cookie-session": "^2.1.0",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
Expand All @@ -42,6 +43,7 @@
"jsonwebtoken": "^9.0.2",
"mailgun-js": "^0.6.7",
"morgan": "^1.10.0",
"multer": "^1.4.4",
"node-fetch": "^2.6.7",
"nodemailer": "^6.9.13",
"nodemon": "^3.1.0",
Expand Down Expand Up @@ -92,6 +94,7 @@
"@types/mocha": "^10.0.7",
"@types/morgan": "^1.9.9",
"@types/node": "^20.14.9",
"@types/multer": "^1.4.11",
"@types/node-cron": "^3.0.11",
"@types/node-fetch": "^2.6.11",
"@types/nodemailer": "^6.4.15",
Expand Down
23 changes: 23 additions & 0 deletions src/__test__/imageUpload.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import request from 'supertest';
import app from '../app';
import { getBuyerToken, afterAllHook, beforeAllHook } from './testSetup';


beforeAll(beforeAllHook);
afterAll(afterAllHook);


describe('Image upload Tests', () => {
let token: string;

beforeAll(async () => {
token = await getBuyerToken()
});

it('should delete profile image successfully', async() => {
const response = await request(app).delete('/api/v1/user/profileImg').set('Authorization',`Bearer ${token}`)
expect(response.status).toBe(200)
expect(response.body.message).toBe('Profile image successfully deleted')
expect(response.body.data).toBeDefined()
})
})
Loading

0 comments on commit 60a10d5

Please sign in to comment.