From df3d44cd02105ee02aede800d0ce91588aaf66bc Mon Sep 17 00:00:00 2001 From: "Christopher J. Brody" Date: Sun, 1 Mar 2020 00:09:21 -0500 Subject: [PATCH] cleanup: use prompt helper for Android package id (internal prompt helper function) and update test snapshots ref:pr #25 --- main.js | 3 +-- .../init-with-example-with-log.test.js.snap | 18 ++++++++++-------- .../no-example-with-log.test.js.snap | 18 ++++++++++-------- .../init-view-no-example-with-log.test.js.snap | 18 ++++++++++-------- ...nit-view-with-example-with-log.test.js.snap | 18 ++++++++++-------- 5 files changed, 41 insertions(+), 34 deletions(-) diff --git a/main.js b/main.js index 79d4a634..90c10c99 100644 --- a/main.js +++ b/main.js @@ -183,11 +183,10 @@ Promise.resolve().then(async () => { const { androidPackageId } = platforms.indexOf('android') !== -1 - ? await prompts({ + ? await prompt({ type: 'text', name: 'androidPackageId', message: 'What is the desired Android package id?', - onState, initial: 'com.demo', validate: androidPackageId => androidPackageId.length > 0 }) diff --git a/tests/init-with-example/__snapshots__/init-with-example-with-log.test.js.snap b/tests/init-with-example/__snapshots__/init-with-example-with-log.test.js.snap index 0d69d28a..b27a0336 100644 --- a/tests/init-with-example/__snapshots__/init-with-example-with-log.test.js.snap +++ b/tests/init-with-example/__snapshots__/init-with-example-with-log.test.js.snap @@ -122,14 +122,16 @@ Array [ }, Object { "prompts": Object { - "args": Object { - "initial": "com.demo", - "message": "What is the desired Android package id?", - "name": "androidPackageId", - "onState": [Function], - "type": "text", - "validate": [Function], - }, + "args": Array [ + Object { + "initial": "com.demo", + "message": "What is the desired Android package id?", + "name": "androidPackageId", + "onState": [Function], + "type": "text", + "validate": [Function], + }, + ], }, }, Object { diff --git a/tests/no-example/__snapshots__/no-example-with-log.test.js.snap b/tests/no-example/__snapshots__/no-example-with-log.test.js.snap index 32ef8fae..62c3e8d1 100644 --- a/tests/no-example/__snapshots__/no-example-with-log.test.js.snap +++ b/tests/no-example/__snapshots__/no-example-with-log.test.js.snap @@ -122,14 +122,16 @@ Array [ }, Object { "prompts": Object { - "args": Object { - "initial": "com.demo", - "message": "What is the desired Android package id?", - "name": "androidPackageId", - "onState": [Function], - "type": "text", - "validate": [Function], - }, + "args": Array [ + Object { + "initial": "com.demo", + "message": "What is the desired Android package id?", + "name": "androidPackageId", + "onState": [Function], + "type": "text", + "validate": [Function], + }, + ], }, }, Object { diff --git a/tests/view/no-example/__snapshots__/init-view-no-example-with-log.test.js.snap b/tests/view/no-example/__snapshots__/init-view-no-example-with-log.test.js.snap index 14155ec6..36d286c9 100644 --- a/tests/view/no-example/__snapshots__/init-view-no-example-with-log.test.js.snap +++ b/tests/view/no-example/__snapshots__/init-view-no-example-with-log.test.js.snap @@ -135,14 +135,16 @@ Array [ }, Object { "prompts": Object { - "args": Object { - "initial": "com.demo", - "message": "What is the desired Android package id?", - "name": "androidPackageId", - "onState": [Function], - "type": "text", - "validate": [Function], - }, + "args": Array [ + Object { + "initial": "com.demo", + "message": "What is the desired Android package id?", + "name": "androidPackageId", + "onState": [Function], + "type": "text", + "validate": [Function], + }, + ], }, }, Object { diff --git a/tests/view/with-example/__snapshots__/init-view-with-example-with-log.test.js.snap b/tests/view/with-example/__snapshots__/init-view-with-example-with-log.test.js.snap index 7d73fa7b..799e1fee 100644 --- a/tests/view/with-example/__snapshots__/init-view-with-example-with-log.test.js.snap +++ b/tests/view/with-example/__snapshots__/init-view-with-example-with-log.test.js.snap @@ -135,14 +135,16 @@ Array [ }, Object { "prompts": Object { - "args": Object { - "initial": "com.demo", - "message": "What is the desired Android package id?", - "name": "androidPackageId", - "onState": [Function], - "type": "text", - "validate": [Function], - }, + "args": Array [ + Object { + "initial": "com.demo", + "message": "What is the desired Android package id?", + "name": "androidPackageId", + "onState": [Function], + "type": "text", + "validate": [Function], + }, + ], }, }, Object {