-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added testing to pull request template * Feature/issue 314 (#319) * Install Cypress & needed packages Update eslint config Update gitignore Add testing development mongo path * Add nock Passport.js Discord request interception * Add Cypress tests * Disable server logging when testing * Fix delay-toggling environment variable Cypress wasn't properly listening to the CYPRESS_NO_DELAYS environment variable to disable the animations waits * added modulus to getHoursAndMinutes --------- Co-authored-by: Caleb Cohen <CalebCohen@hotmail.com> * starting workflow for actions * typo within review pull request * add environment dev to workflow * workflow changes * lint fixes (#324) * Actions timeout (#326) * Add timeout to GitHub actions GitHub action workflows should be limited so minutes aren't wasted if it hangs and bugs can be caught earlier. If 30 minutes isn't enough, it can be increased later on * change timeout to 10 minutes * Modified app metadata to "Together is a scheduling and collaboration … (#325) * Modified app metadata to "Together is a scheduling and collaboration tool built for and by 100Devs community for creating, discovering and keeping track of events on discord." * Deleted the extra space. * Server tests. #288 (#289) * install jest and supertest * separate app and server into different files * add jest coverage folder to gitignore * allow the use of mock user in test environment * change validateBody to be a sync function * add 'use strict', fix variable declarations * extract constants * remove console logs * add mock user to db * refactor, fix validation bugs in createEventSchema * test httpError * test validateObjectId * test validateBody * refactor unit tests * export STRING_MAX_LENGTH to be used in tests * fix dotenv path to work in tests * modify mock request * test routes * refactor maxEvents middleware * add tests for maxEvents * allow event end time (not date) to be before start time * test create event with valid data * timezone bug fix: add offset to days * test createEventArray * create date range with Date instead of datefns lib * test createEventsArray in JST timezone * refactor createEventsArray and tests * fix test JST time * use Temporal to work with dates * fix event duration using Temporal * test cases for createEventsArray * test validateBody * fix acceptance tests * change hardcoded timezone to machine timezone * update test script * remove irrelevant test (maxEvents) * update front-end test * add script to run all tests together * add route tests * added formidable, jsbi, moved jest and supertest to dev dependencies --------- Co-authored-by: Caleb Cohen <CalebCohen@hotmail.com> * Fix guest modal and and updated test (#327) * Fix guest modal and and updated test * author changes and lint fix * Make time-asserting code locale-based --------- Co-authored-by: Rascal_Two <therealrascaltwo@gmail.com> * Removed delete all button from non-recurring events (#332) * Removed delete all button from non-recurring events * Removed console.log from file * Feature/issue 305 (#339) * changed description section input element to textarea element. This change added multi-line functionality and a larger textbox size. * In the input object, I changed the input element text to textarea. Cypress now reflects the changes made in the codebase for proper testing. * Created a close button, in UserForm.js (#333) --------- Co-authored-by: Rascal Two <therealrascaltwo@gmail.com> Co-authored-by: Jacob Asper <jacobasper191@gmail.com> Co-authored-by: uaravindshenoy <75222342+uaravindshenoy@users.noreply.github.com> Co-authored-by: Roman Stetsyk <25715951+romanstetsyk@users.noreply.github.com> Co-authored-by: Lalysi <75863568+lalysi@users.noreply.github.com> Co-authored-by: Mike Jakuszewski <114702999+MikeJakuszewski@users.noreply.github.com> Co-authored-by: Jae Salaski <hello@jsalaski.com>
- Loading branch information
1 parent
f08f5be
commit f22f80d
Showing
52 changed files
with
8,211 additions
and
4,434 deletions.
There are no files selected for viewing
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
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,51 @@ | ||
name: Review Pull Request | ||
|
||
on: | ||
|
||
push: | ||
branches: | ||
- main | ||
- development | ||
pull_request: | ||
branches: | ||
- main | ||
- development | ||
|
||
permissions: | ||
checks: write | ||
contents: write | ||
|
||
jobs: | ||
review-pull-request: | ||
name: Run tests to review pull requests | ||
timeout-minutes: 10 | ||
runs-on: ubuntu-latest | ||
environment: DEV | ||
env: | ||
DB_STRING: ${{ vars.DB_STRING }} | ||
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }} | ||
DISCORD_CLIENT_SECRET: ${{ secrets.DISCORD_CLIENT_SECRET }} | ||
OAUTH_REDIRECT_URL: ${{ vars.OAUTH_REDIRECT_URL }} | ||
MOCK_USER: ${{ vars.MOCK_USER }} | ||
NODE_ENV: ${{ vars.NODE_ENV }} | ||
|
||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 16.15.0 | ||
|
||
- name: Install Node.js dependencies | ||
run: npm ci | ||
|
||
- name: Run linters | ||
uses: wearerequired/lint-action@v2 | ||
with: | ||
eslint: true | ||
|
||
- name: Run Front end test | ||
run: npm run test-frontend | ||
|
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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,55 @@ | ||
const { defineConfig } = require("cypress"); | ||
|
||
module.exports = defineConfig({ | ||
env: { | ||
CYPRESS_NO_DELAYS: process.env.CYPRESS_NO_DELAYS | ||
}, | ||
e2e: { | ||
baseUrl: "http://localhost:3000", | ||
experimentalRunAllSpecs: true, | ||
setupNodeEvents(on, config) { | ||
require("@cypress/code-coverage/task")(on, config); | ||
on("task", { | ||
clearDatabase() { | ||
require("dotenv").config({ path: "./server/config/.env" }); | ||
return require("./server/config/database")().then(async conn => { | ||
for (const { name } of await conn.connection.db | ||
.listCollections() | ||
.toArray()) { | ||
await conn.connection.db.collection(name).deleteMany(); | ||
} | ||
return null; | ||
}); | ||
}, | ||
createEvent({ | ||
title, | ||
description, | ||
startAt, | ||
endAt, | ||
location, | ||
user, | ||
groupId, | ||
}) { | ||
require("dotenv").config({ path: "./server/config/.env" }); | ||
return require("./server/config/database")().then(async () => { | ||
const { Event } = require("./server/models/Event"); | ||
const event = await Event.create({ | ||
title, | ||
description, | ||
startAt, | ||
endAt, | ||
location, | ||
user, | ||
groupId, | ||
}); | ||
return event; | ||
}); | ||
}, | ||
generateObjectId() { | ||
return require("mongoose").Types.ObjectId().toString(); | ||
}, | ||
}); | ||
return config; | ||
}, | ||
}, | ||
}); |
Oops, something went wrong.