dev-api: add developer portal, OpenAPI spec, and Flatenbadet case study
- New /developers/ page with API docs, SDKs, pricing, use cases - OpenAPI 3.0 spec for Orders, Missions, Photos, Analytics - Case study: Glasskiosken i Flatenbadet — complete ROI analysis - Updated /order/ with recurring missions and frequency dropdown
This commit is contained in:
Generated
Vendored
+31
@@ -0,0 +1,31 @@
|
||||
'use strict'
|
||||
|
||||
const tap = require('tap')
|
||||
const getPropertyValue = require('./get-property-value')
|
||||
|
||||
tap.test('getPropertyValue returns the value of the property', async t => {
|
||||
const result = getPropertyValue({
|
||||
foo: 'bar'
|
||||
}, 'foo')
|
||||
t.same(result, 'bar')
|
||||
})
|
||||
|
||||
tap.test('getPropertyValue returns the value of the nested property', async t => {
|
||||
const result = getPropertyValue({ extra: { foo: { value: 'bar' } } }, 'extra.foo.value')
|
||||
t.same(result, 'bar')
|
||||
})
|
||||
|
||||
tap.test('getPropertyValue returns the value of the nested property using the array of nested property keys', async t => {
|
||||
const result = getPropertyValue({ extra: { foo: { value: 'bar' } } }, ['extra', 'foo', 'value'])
|
||||
t.same(result, 'bar')
|
||||
})
|
||||
|
||||
tap.test('getPropertyValue returns undefined for non-existing properties', async t => {
|
||||
const result = getPropertyValue({ extra: { foo: { value: 'bar' } } }, 'extra.foo.value-2')
|
||||
t.same(result, undefined)
|
||||
})
|
||||
|
||||
tap.test('getPropertyValue returns undefined for non-existing properties using the array of nested property keys', async t => {
|
||||
const result = getPropertyValue({ extra: { foo: { value: 'bar' } } }, ['extra', 'foo', 'value-2'])
|
||||
t.same(result, undefined)
|
||||
})
|
||||
Reference in New Issue
Block a user