Skip to content

Commit

Permalink
Fixed Build and Unit Test issues
Browse files Browse the repository at this point in the history
  • Loading branch information
BanEvading committed Feb 14, 2025
1 parent 8f2928b commit 1e445d0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions pages/onboarding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ export default function Onboarding() {
team?.tbaId ?? NotLinkedToTba,
teamNumber,
league,
false,
);
if (!newTeam) {
setErrorMsg("Failed to create team");
Expand Down
17 changes: 9 additions & 8 deletions tests/lib/api/ClientApi.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ describe(`${ClientApi.name}.${api.requestToJoinTeam.name}`, () => {
"tbaId",
1234,
League.FRC,
false,
[user._id!.toString()],
[user._id!.toString()],
),
Expand Down Expand Up @@ -131,7 +132,7 @@ describe(`${ClientApi.name}.${api.handleTeamJoinRequest.name}`, () => {
const teamId = new ObjectId();

await db.addObject(CollectionId.Teams, {
...new Team("Test Team", "test-team", "tbaId", 1234, League.FRC, [
...new Team("Test Team", "test-team", "tbaId", 1234, League.FRC, false, [
user._id!.toString(),
]),
_id: teamId,
Expand Down Expand Up @@ -163,7 +164,7 @@ describe(`${ClientApi.name}.${api.handleTeamJoinRequest.name}`, () => {
const teamId = new ObjectId();

await db.addObject(CollectionId.Teams, {
...new Team("Test Team", "test-team", "tbaId", 1234, League.FRC, [
...new Team("Test Team", "test-team", "tbaId", 1234, League.FRC, false, [
user._id!.toString(),
]),
_id: teamId,
Expand Down Expand Up @@ -578,7 +579,7 @@ describe(`${ClientApi.name}.${api.updateTeam.name}`, () => {
test(`${ClientApi.name}.${api.updateTeam.name}: Updates team`, async () => {
const { db, res, user } = await getTestApiUtils();

const team = new Team("Test Team", "test-team", "tbaId", 1234, League.FRC, [
const team = new Team("Test Team", "test-team", "tbaId", 1234, League.FRC, false, [
user._id!.toString(),
]);
await db.addObject(CollectionId.Teams, team);
Expand Down Expand Up @@ -623,7 +624,7 @@ describe(`${ClientApi.name}.${api.updateSeason.name}`, () => {
test(`${ClientApi.name}.${api.updateSeason.name}: Updates season`, async () => {
const { db, res, user } = await getTestApiUtils();

const team = new Team("Test Team", "test-team", "tbaId", 1234, League.FRC, [
const team = new Team("Test Team", "test-team", "tbaId", 1234, League.FRC, false, [
user._id!.toString(),
]);
await db.addObject(CollectionId.Teams, team);
Expand Down Expand Up @@ -683,7 +684,7 @@ describe(`${ClientApi.name}.${api.updateReport.name}`, () => {
test(`${ClientApi.name}.${api.updateReport.name}: Updates report`, async () => {
const { db, res, user } = await getTestApiUtils();

const team = new Team("Test Team", "test-team", "tbaId", 1234, League.FRC, [
const team = new Team("Test Team", "test-team", "tbaId", 1234, League.FRC, false, [
user._id!.toString(),
]);
await db.addObject(CollectionId.Teams, team);
Expand Down Expand Up @@ -754,7 +755,7 @@ describe(`${ClientApi.name}.${api.updatePitreport.name}`, () => {
test(`${ClientApi.name}.${api.updatePitreport.name}: Updates pitreport`, async () => {
const { db, res, user } = await getTestApiUtils();

const team = new Team("Test Team", "test-team", "tbaId", 1234, League.FRC, [
const team = new Team("Test Team", "test-team", "tbaId", 1234, League.FRC, false, [
user._id!.toString(),
]);
await db.addObject(CollectionId.Teams, team);
Expand Down Expand Up @@ -830,7 +831,7 @@ describe(`${ClientApi.name}.${api.setSlackWebhook.name}`, () => {
test(`${ClientApi.name}.${api.setSlackWebhook.name}: Sets webhook URL when team does not already have one`, async () => {
const { db, res, user } = await getTestApiUtils();

const team = new Team("Test Team", "test-team", "tbaId", 1234, League.FRC, [
const team = new Team("Test Team", "test-team", "tbaId", 1234, League.FRC, false, [
user._id!.toString(),
]);
await db.addObject(CollectionId.Teams, team);
Expand Down Expand Up @@ -866,7 +867,7 @@ describe(`${ClientApi.name}.${api.setSlackWebhook.name}`, () => {
test(`${ClientApi.name}.${api.setSlackWebhook.name}: Updates webhook URL when team already has one`, async () => {
const { db, res, user } = await getTestApiUtils();

const team = new Team("Test Team", "test-team", "tbaId", 1234, League.FRC, [
const team = new Team("Test Team", "test-team", "tbaId", 1234, League.FRC, false, [
user._id!.toString(),
]);
await db.addObject(CollectionId.Teams, team);
Expand Down

0 comments on commit 1e445d0

Please sign in to comment.