Skip to content

Commit 6bcf573

Browse files
authored
Merge pull request #27 from stevieing/fix_bug_all_wells_in_triplicate_empty
id needs to be included if all of the wells are empty.
2 parents f71240c + c22b531 commit 6bcf573

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

src/lib/Triplicates.js

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class Triplicate {
2424
}
2525

2626
get id () {
27-
if (this.empty()) return ''
2827
return this.wells[0].id
2928
}
3029

test/unit/specs/Triplicates.spec.js

+21
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,27 @@ describe('Triplicates.vue', () => {
213213
expect(triplicate.cv).toEqual('0')
214214
})
215215
})
216+
217+
describe('when all 3 values are n.a.', () => {
218+
beforeEach(() => {
219+
well1.concentration = 'n.a.'
220+
well2.concentration = 'n.a.'
221+
well3.concentration = 'n.a.'
222+
triplicate = new Triplicate([well1, well2, well3])
223+
})
224+
225+
it('standard deviation will be 0', () => {
226+
expect(triplicate.standardDeviation).toEqual('0')
227+
})
228+
229+
it('cv will be 0', () => {
230+
expect(triplicate.cv).toEqual('0')
231+
})
232+
233+
it('still has an id', () => {
234+
expect(triplicate.id).toEqual(well1.id)
235+
})
236+
})
216237
})
217238

218239
describe('Triplicates', () => {

0 commit comments

Comments
 (0)