mercredi 10 août 2016

Is it meaningful to test very simple Angular controllers?

This is one of our controllers. It is a very simple controller as you can see.

angular.
module("printing").
controller("PrintController", function PrintController(
    $window,
    localize,
    PartsEnum,
    IsBitIncluded
) {
    "use strict";

    this.PartsEnum = ExamPartsEnum;
    this.IsBitIncluded = IsBitIncluded;

    this.origin = $window.location.protocol + "//" + $window.location.host;

    this.optionsText = [
        localize.get("Yes"),
        localize.get("Maybe"),
        localize.get("No"),
    ];
});

  • Should we write tests for this controller? If you need more information to be able to answer this, write information would sway your answer in any direction
  • What should we test about this controller? It does almost nothing. What is there to test?

Aucun commentaire:

Enregistrer un commentaire