Skip to content

Commit

Permalink
feat: Include hoursBeforeEarlyXpDecay in response (#1156)
Browse files Browse the repository at this point in the history
* feat: Include hoursBeforeEarlyXpDecay in response

* fix: Fix tests
  • Loading branch information
GabrielCWT authored Aug 23, 2024
1 parent 9723ec3 commit fbc8e15
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/cadet_web/views/assessments_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ defmodule CadetWeb.AssessmentsView do
maxTeamSize: :max_team_size,
hasVotingFeatures: :has_voting_features,
hasTokenCounter: :has_token_counter,
isVotingPublished: &is_voting_assigned(&1.id)
isVotingPublished: &is_voting_assigned(&1.id),
hoursBeforeEarlyXpDecay: & &1.config.hours_before_early_xp_decay
})
end

Expand Down
7 changes: 5 additions & 2 deletions test/cadet_web/controllers/assessments_controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ defmodule CadetWeb.AssessmentsControllerTest do
"earlySubmissionXp" => &1.config.early_submission_xp,
"hasVotingFeatures" => &1.has_voting_features,
"hasTokenCounter" => &1.has_token_counter,
"isVotingPublished" => Assessments.is_voting_published(&1.id)
"isVotingPublished" => Assessments.is_voting_published(&1.id),
"hoursBeforeEarlyXpDecay" => &1.config.hours_before_early_xp_decay
}
)

Expand Down Expand Up @@ -173,7 +174,8 @@ defmodule CadetWeb.AssessmentsControllerTest do
"earlySubmissionXp" => &1.config.early_submission_xp,
"hasVotingFeatures" => &1.has_voting_features,
"hasTokenCounter" => &1.has_token_counter,
"isVotingPublished" => Assessments.is_voting_published(&1.id)
"isVotingPublished" => Assessments.is_voting_published(&1.id),
"hoursBeforeEarlyXpDecay" => &1.config.hours_before_early_xp_decay
}
)

Expand Down Expand Up @@ -289,6 +291,7 @@ defmodule CadetWeb.AssessmentsControllerTest do
"isVotingPublished" => Assessments.is_voting_published(&1.id),
"earlySubmissionXp" => &1.config.early_submission_xp,
"isGradingPublished" => nil,
"hoursBeforeEarlyXpDecay" => &1.config.hours_before_early_xp_decay,
"isPublished" =>
if &1.config.type == hd(configs).type do
false
Expand Down

0 comments on commit fbc8e15

Please sign in to comment.