Skip to content

Commit

Permalink
Merge pull request #1239 from siiky/fix/lam-903/recycler-notifs
Browse files Browse the repository at this point in the history
LAM-903 fix: mock empty/fill units
  • Loading branch information
RafaelTaranto authored Nov 28, 2024
2 parents c9ef0f3 + 1c5fedb commit c8e5b82
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/mocks/gsr50/gsr50.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,13 @@ Gsr50.prototype.refillUnit = function refillUnit () {
}

Gsr50.prototype.updateCounts = function updateCounts (newCounts) {
const updateClassCounts = arr =>
arr.map(box => {
const count = newCounts[box.name]
return count ? Object.assign(box, { count }) : box
})
this.cassettes = updateClassCounts(this.cassettes)
this.recyclers = updateClassCounts(this.recyclers)
}

module.exports = Gsr50

0 comments on commit c8e5b82

Please sign in to comment.