seatsio 67.4.0 → 67.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seatsio",
3
- "version": "67.4.0",
3
+ "version": "67.5.0",
4
4
  "main": "index.js",
5
5
  "description": "Official JavaScript and Node.JS client library for the Seats.io REST API",
6
6
  "license": "MIT",
@@ -14,6 +14,7 @@ class StatusChange {
14
14
  this.holdToken = statusChange.holdToken ? statusChange.holdToken : null
15
15
  this.origin = statusChange.origin
16
16
  this.isPresentOnChart = statusChange.isPresentOnChart
17
+ this.notPresentOnChartReason = statusChange.notPresentOnChartReason
17
18
  this.displayedLabel = statusChange.displayedLabel ? statusChange.displayedLabel : null
18
19
  }
19
20
  }
@@ -2,6 +2,7 @@ const testUtils = require('../testUtils.js')
2
2
  const ObjectProperties = require('../../src/Events/ObjectProperties.js')
3
3
  const EventObjectInfo = require('../../src/Events/EventObjectInfo.js')
4
4
  const StatusChangesParams = require('../../src/Events/StatusChangesParams.js')
5
+ const {TableBookingconfig} = require("../../index");
5
6
 
6
7
  test('should list all status changes', async () => {
7
8
  const { client, user } = await testUtils.createTestUserAndClient()
@@ -176,6 +177,23 @@ test('properties of status changes', async () => {
176
177
  expect(statusChange.value.origin.type).toBe('API_CALL')
177
178
  expect(statusChange.value.displayedLabel).toBe('A-1')
178
179
  expect(statusChange.value.isPresentOnChart).toBe(true)
180
+ expect(statusChange.value.notPresentOnChartReason).toBe(undefined)
181
+ })
182
+
183
+ test('not present on chart anymore', async () => {
184
+ const { client, user } = await testUtils.createTestUserAndClient()
185
+ const chartKey = testUtils.getChartKey()
186
+ await testUtils.createTestChartWithTables(chartKey, user.secretKey)
187
+ const event = await client.events.create(chartKey, null, TableBookingconfig.allByTable())
188
+ await client.events.book(event.key, 'T1')
189
+ await client.events.update(event.key, null, null, TableBookingconfig.allBySeat())
190
+
191
+ const statusChanges = client.events.statusChanges(event.key).all()
192
+ const statusChangesIterator = statusChanges[Symbol.asyncIterator]()
193
+ const statusChange = await statusChangesIterator.next()
194
+
195
+ expect(statusChange.value.isPresentOnChart).toBe(false)
196
+ expect(statusChange.value.notPresentOnChartReason).toBe('SWITCHED_TO_BOOK_BY_SEAT')
179
197
  })
180
198
 
181
199
  test('should list status changes with hold token', async () => {