diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-04-28 11:35:30 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-04-28 11:35:30 +0200 |
commit | 78e00db018f1f3e69a612fe8a7cf8787bdef4fd5 (patch) | |
tree | 1c9e1a329818ca5fb357910d638f1d37f37fb66c /lib/models | |
parent | e62bc31e6363084fb3e138a5fcfd799105d353b8 (diff) | |
download | gitbook-78e00db018f1f3e69a612fe8a7cf8787bdef4fd5.zip gitbook-78e00db018f1f3e69a612fe8a7cf8787bdef4fd5.tar.gz gitbook-78e00db018f1f3e69a612fe8a7cf8787bdef4fd5.tar.bz2 |
Add tests for SummaryModifier.editPartTitle
Diffstat (limited to 'lib/models')
-rw-r--r-- | lib/models/__tests__/summary.js | 1 | ||||
-rw-r--r-- | lib/models/summary.js | 11 |
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/models/__tests__/summary.js b/lib/models/__tests__/summary.js index e7b496e..ad040cf 100644 --- a/lib/models/__tests__/summary.js +++ b/lib/models/__tests__/summary.js @@ -1,4 +1,3 @@ -jest.autoMockOff(); describe('Summary', function() { var File = require('../file'); diff --git a/lib/models/summary.js b/lib/models/summary.js index 444c191..b04630f 100644 --- a/lib/models/summary.js +++ b/lib/models/summary.js @@ -20,6 +20,17 @@ Summary.prototype.getParts = function() { }; /** + Return a part by its index + + @param {Number} + @return {Part} +*/ +Summary.prototype.getPart = function(i) { + var parts = this.getParts(); + return parts.get(i); +}; + +/** Return an article using an iterator to find it. if "partIter" is set, it can also return a Part. |