+# The Router unit test.
+#
+# Note: image detail load cannot be unit-tested, since it requires an
+# active browser.
 define ['angular', 'lodash', 'ngmocks', 'expect', 'moment', 'router'],
   (ng, _, mocks, expect, moment, router) ->
-    describe 'Unit Testing Router', ->
+    describe 'Unit Testing the Router', ->
       # The mock Router service module.
       Router = null
 

          expect(subject.birthDate, "Subject is missing a birth date").to.exist
          expect(subject.birthDate.valueOf(), "Subject birth date is incorrect")
            .to.equal(mock.subject_detail.birth_date)
          # There should be encounters.
          expect(subject.encounters, "Subject is missing encounters").to.exist
          expect(subject.encounters.length, "Subject encounters length is incorrect")
            .to.equal(1)
          enc = subject.encounters[0]
          expect(enc.encounter._cls, "Encounter type is incorrect")
            .to.equal(mock.subject_detail.encounters[0]._cls)
          # There should be treatments.
          expect(subject.treatments, "Subject is missing treatments").to.exist
          expect(subject.treatments.length, "Subject encounters length is incorrect")

            .to.equal(mock.subject_detail.treatments[0].treatment_type)
          expect(trt.begin_date.valueOf(), "Treatment begin date is incorrect")
            .to.equal(mock.subject_detail.treatments[0].begin_date)

          # Validate the modeling.
          expect(subject.modeling, "Subject is missing modeling").to.exist
          expect(subject.modeling.length, "The subject modeling length is incorrect")
            .to.equal(4)
          # The first modeling is for the T1 scan.
          mdl = subject.modeling[0]
          expect(mdl.source, "Modeling is missing a source").to.exist
          expect(mdl.source.scanType, "Modeling source is missing the scan type")
            .to.exist
          expect(mdl.source.scanType, "Modeling source scan type is incorrect")
            .to.equal('t1')
          mockMdl = mock.subject_detail.scan_sets.t1.modeling
          expect(mdl.results, "Modeling is missing results").to.exist
          expect(mdl.results.length, "Modeling results count is incorrect").
            to.equal(1)
          mdlResult = mdl.results[0]
          expect(mdlResult.deltaKTrans, "Modeling results is missing deltaKTrans")
            .to.exist
          expect(mdlResult.deltaKTrans.average, "Modeling deltaKTrans is incorrect")
            .to.equal(mockMdl.results[0].delta_k_trans.average)
          # The modeling result object refers to its respective session.
          expect(mdlResult.session, "Modeling results is missing session").to.exist
          expect(mdlResult.session, "Modeling results session is incorrect")
            .to.equal(subject.sessions[0])

          # There should be sessions.
          expect(subject.sessions, "Subject is missing sessions").to.exist
          expect(subject.sessions.length, "Subject sessions length is incorrect")
