Skip to content

Task [ Implementation ] : Integrate the backend testcases in modules #129

@khushijoshi1234

Description

@khushijoshi1234

Issues & Test Coverage Gaps :

quiz_controller.go ( Improvement )

  • In QuizController.GenerateDemoSession(), if ctrl.activeQuizModel.CreateActiveQuiz succeeds but ctrl.activeQuizModel.GetQuestionsCopy fails, the demo session (sessionId) is still created in the database.
  • However, the questions are not copied, which leaves the session in an incomplete and inconsistent state. This case is currently not handled.

utils/validator_test.go ( Incomplete-Tests )

  • The current test file only covers ValidateEmail.
  • The following functions are not tested:
    ValidatorErrorString, ValidateGlobalEmail

helpers/utils/validating_test.go ( Incomplete-Tests )

  • The validation function enforces four independent rules, Current tests cover only one valid case.
  • This does not fully validate all four rules. Additional test cases are required to cover numeric validation and boundary conditions.

helpers/utils/generator.go ( Missing-Tests )

  • No test cases have been written for this file. Test coverage should be added.

helpers/utils/converter_test.go ( Incorrect-Tests )

  • assert.IsType checks the type, not the value.
  • Currently, expected is set to "abcd", which is a value, not a type reference. This makes the assertion unclear.
  • The actual intention appears to be verifying that GetString always returns a string.
  • Using the following assertion is more appropriate:
    assert.IsType(t, "", actual)
    Additionally:
  • Missing tests for GetBool
  • Missing tests for ConvertType

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions