-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #133 from saurabhbakolia/develop
Develop to Master
- Loading branch information
Showing
109 changed files
with
22,335 additions
and
44,808 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Greetings | ||
|
||
on: [pull_request_target, issues] | ||
|
||
jobs: | ||
greeting: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
steps: | ||
- uses: actions/first-interaction@v1 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
issue-message: "👋 Thank you @${{ github.actor }} for raising an issue! We appreciate your effort in helping us improve. Our team will review it shortly. Stay tuned!" | ||
pr-message: " 🎉 Thank you @${{ github.actor }} for your contribution! Your pull request has been submitted successfully. A maintainer will review it as soon as possible. We appreciate your support in making this project better" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
npm run lint-fix && npm run lint-format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
build | ||
dist | ||
*.min.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,24 @@ | ||
module.exports = { | ||
trailingComma: "es5", | ||
tabWidth: 2, | ||
semi: true, | ||
singleQuote: true, | ||
arrowParens: 'always', | ||
trailingComma: 'es5', | ||
tabWidth: 4, | ||
semi: true, | ||
singleQuote: true, | ||
bracketSpacing: true, | ||
embeddedLanguageFormatting: 'auto', | ||
htmlWhitespaceSensitivity: 'css', | ||
insertPragma: false, | ||
jsxBracketSameLine: false, | ||
jsxSingleQuote: true, | ||
proseWrap: 'preserve', | ||
quoteProps: 'as-needed', | ||
requirePragma: false, | ||
semi: true, | ||
singleQuote: true, | ||
trailingComma: 'es5', | ||
useTabs: false, | ||
vueIndentScriptAndStyle: false, | ||
printWidth: 140, | ||
tabWidth: 2, | ||
rangeStart: 0, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
npm run lint && npm run format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,71 @@ | ||
const request = require("supertest"); | ||
const app = require("../server.js"); | ||
const request = require('supertest'); | ||
const app = require('../server.js'); | ||
|
||
describe("Auth Routes", () => { | ||
it("should register a new user", async () => { | ||
const response = await request(app).post("/api/auth/register").send({ | ||
firstName: "Test", | ||
lastName: "Test", | ||
username: "test", | ||
email: "[email protected]", | ||
password: "test123", | ||
}); | ||
describe('Auth Routes', () => { | ||
it('should register a new user', async () => { | ||
const response = await request(app).post('/api/auth/register').send({ | ||
firstName: 'Test', | ||
lastName: 'Test', | ||
username: 'test', | ||
email: '[email protected]', | ||
password: 'test123', | ||
}); | ||
|
||
expect(response.status).toBe(400); | ||
expect(response.status).toBe(400); | ||
|
||
// const setCookieHeader = response.headers['set-cookie']; | ||
// expect(setCookieHeader).toBeDefined(); | ||
// expect(Array.isArray(setCookieHeader)).toBe(true); | ||
// expect(setCookieHeader).not.toHaveLength(0); | ||
// const refreshTokenCookie = setCookieHeader.find( | ||
// (cookie) => cookie.startsWith('refreshToken=') | ||
// ); | ||
// expect(refreshTokenCookie).toBeDefined(); | ||
}); | ||
// const setCookieHeader = response.headers['set-cookie']; | ||
// expect(setCookieHeader).toBeDefined(); | ||
// expect(Array.isArray(setCookieHeader)).toBe(true); | ||
// expect(setCookieHeader).not.toHaveLength(0); | ||
// const refreshTokenCookie = setCookieHeader.find( | ||
// (cookie) => cookie.startsWith('refreshToken=') | ||
// ); | ||
// expect(refreshTokenCookie).toBeDefined(); | ||
}); | ||
|
||
// it("should login an existing user and return tokens", async () => { | ||
// const response = await request(app).post("/api/auth/login").send({ | ||
// email: "[email protected]", | ||
// password: "password123", | ||
// }); | ||
// it("should login an existing user and return tokens", async () => { | ||
// const response = await request(app).post("/api/auth/login").send({ | ||
// email: "[email protected]", | ||
// password: "password123", | ||
// }); | ||
|
||
// expect(response.status).toBe(200); | ||
// expect(response.headers["set-cookie"]).toBeInstanceOf(Array); | ||
// expect(response.headers["set-cookie"]).not.toHaveLength(0); | ||
// const cookies = response.headers["set-cookie"].map( | ||
// (cookie) => cookie.split(";")[0], | ||
// ); | ||
// expect(cookies).toEqual( | ||
// expect.arrayContaining([expect.stringMatching(/^accessToken=/)]), | ||
// ); | ||
// expect(cookies).toEqual( | ||
// expect.arrayContaining([expect.stringMatching(/^refreshToken=/)]), | ||
// ); | ||
// }); | ||
// expect(response.status).toBe(200); | ||
// expect(response.headers["set-cookie"]).toBeInstanceOf(Array); | ||
// expect(response.headers["set-cookie"]).not.toHaveLength(0); | ||
// const cookies = response.headers["set-cookie"].map( | ||
// (cookie) => cookie.split(";")[0], | ||
// ); | ||
// expect(cookies).toEqual( | ||
// expect.arrayContaining([expect.stringMatching(/^accessToken=/)]), | ||
// ); | ||
// expect(cookies).toEqual( | ||
// expect.arrayContaining([expect.stringMatching(/^refreshToken=/)]), | ||
// ); | ||
// }); | ||
|
||
// it("should refresh access token using refresh token", async () => { | ||
// const loginResponse = await request(app).post("/api/auth/login").send({ | ||
// email: "[email protected]", | ||
// password: "password123", | ||
// }); | ||
// it("should refresh access token using refresh token", async () => { | ||
// const loginResponse = await request(app).post("/api/auth/login").send({ | ||
// email: "[email protected]", | ||
// password: "password123", | ||
// }); | ||
|
||
// expect(loginResponse.status).toBe(200); | ||
// expect(loginResponse.status).toBe(200); | ||
|
||
// // Ensure set-cookie header exists before using it | ||
// const setCookieHeader = loginResponse.headers["set-cookie"]; | ||
// expect(setCookieHeader).toBeDefined(); | ||
// expect(Array.isArray(setCookieHeader)).toBe(true); | ||
// expect(setCookieHeader).not.toHaveLength(0); // Check that set-cookie header is not empty | ||
// // Ensure set-cookie header exists before using it | ||
// const setCookieHeader = loginResponse.headers["set-cookie"]; | ||
// expect(setCookieHeader).toBeDefined(); | ||
// expect(Array.isArray(setCookieHeader)).toBe(true); | ||
// expect(setCookieHeader).not.toHaveLength(0); // Check that set-cookie header is not empty | ||
|
||
// // Check for refreshToken cookie | ||
// const refreshTokenCookie = setCookieHeader.find((cookie) => | ||
// cookie.startsWith("refreshToken="), | ||
// ); | ||
// expect(refreshTokenCookie).toBeDefined(); | ||
// // Check for refreshToken cookie | ||
// const refreshTokenCookie = setCookieHeader.find((cookie) => | ||
// cookie.startsWith("refreshToken="), | ||
// ); | ||
// expect(refreshTokenCookie).toBeDefined(); | ||
|
||
// // Check for accessToken cookie | ||
// expect(setCookieHeader).toEqual( | ||
// expect.arrayContaining([expect.stringMatching(/^accessToken=/)]), | ||
// ); | ||
// }); | ||
// // Check for accessToken cookie | ||
// expect(setCookieHeader).toEqual( | ||
// expect.arrayContaining([expect.stringMatching(/^accessToken=/)]), | ||
// ); | ||
// }); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
// This file should only contain setup code, not tests. | ||
require("@testing-library/jest-dom/extend-expect"); // For extended DOM assertions | ||
require('@testing-library/jest-dom/extend-expect'); // For extended DOM assertions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
require("dotenv").config(); | ||
describe("Environment Variables", () => { | ||
it("should load JWT_SECRET from environment variables", () => { | ||
// Ensure the JWT_SECRET environment variable is loaded | ||
expect(process.env.JWT_SECRET).toBeDefined(); | ||
// Optionally, you can check its value or other properties | ||
expect(process.env.JWT_SECRET).toBe("someone"); | ||
}); | ||
require('dotenv').config(); | ||
describe('Environment Variables', () => { | ||
it('should load JWT_SECRET from environment variables', () => { | ||
// Ensure the JWT_SECRET environment variable is loaded | ||
expect(process.env.JWT_SECRET).toBeDefined(); | ||
// Optionally, you can check its value or other properties | ||
expect(process.env.JWT_SECRET).toBe('someone'); | ||
}); | ||
}); |
Oops, something went wrong.