-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use expect.toMatchSnapshot to test conplex frames
- Loading branch information
Showing
11 changed files
with
198 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
packages/prompts/__tests__/prompts/__snapshots__/group-multiselect.spec.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`groupMultiselect should render error 1`] = ` | ||
"[90m│[39m | ||
[33m▲[39m test message | ||
[33m│[39m [2m[22m[36m◻[39m changed packages | ||
[33m│[39m │ [36m◻[39m [2m@scope/a[22m | ||
[33m│[39m │ [36m◻[39m [2m@scope/b[22m | ||
[33m│[39m └ [36m◻[39m [2m@scope/c[22m | ||
[33m│[39m [2m[22m[2m◻[22m [2munchanged packages[22m | ||
[33m│[39m [2m│ [22m[2m◻[22m [2m@scope/x[22m | ||
[33m│[39m [2m│ [22m[2m◻[22m [2m@scope/y[22m | ||
[33m│[39m [2m└ [22m[2m◻[22m [2m@scope/z[22m | ||
[33m└[39m [33mPlease select at least one option.[39m | ||
[8m-[28m [0m[2mPress [90m[47m[7m space [27m[49m[39m to select, [90m[47m[7m enter [27m[49m[39m to submit[22m[0m | ||
" | ||
`; | ||
|
||
exports[`groupMultiselect should render initial state 1`] = ` | ||
"[90m│[39m | ||
[36m◆[39m test message | ||
[36m│[39m [2m[22m[36m◻[39m changed packages | ||
[36m│[39m │ [36m◻[39m [2m@scope/a[22m | ||
[36m│[39m │ [36m◻[39m [2m@scope/b[22m | ||
[36m│[39m └ [36m◻[39m [2m@scope/c[22m | ||
[36m│[39m [2m[22m[2m◻[22m [2munchanged packages[22m | ||
[36m│[39m [2m│ [22m[2m◻[22m [2m@scope/x[22m | ||
[36m│[39m [2m│ [22m[2m◻[22m [2m@scope/y[22m | ||
[36m│[39m [2m└ [22m[2m◻[22m [2m@scope/z[22m | ||
[36m└[39m | ||
" | ||
`; | ||
|
||
exports[`groupMultiselect should render initial state with option active 1`] = ` | ||
"[90m│[39m | ||
[36m◆[39m test message | ||
[36m│[39m [2m[22m[2m◻[22m [2mchanged packages[22m | ||
[36m│[39m [2m│ [22m[36m◻[39m @scope/a | ||
[36m│[39m [2m│ [22m[2m◻[22m [2m@scope/b[22m | ||
[36m│[39m [2m└ [22m[2m◻[22m [2m@scope/c[22m | ||
[36m│[39m [2m[22m[2m◻[22m [2munchanged packages[22m | ||
[36m│[39m [2m│ [22m[2m◻[22m [2m@scope/x[22m | ||
[36m│[39m [2m│ [22m[2m◻[22m [2m@scope/y[22m | ||
[36m│[39m [2m└ [22m[2m◻[22m [2m@scope/z[22m | ||
[36m└[39m | ||
" | ||
`; | ||
|
||
exports[`groupMultiselect should render initial state with option active and selected 1`] = ` | ||
"[90m│[39m | ||
[36m◆[39m test message | ||
[36m│[39m [2m[22m[2m◻[22m [2mchanged packages[22m | ||
[36m│[39m [2m│ [22m[32m◼[39m @scope/a | ||
[36m│[39m [2m│ [22m[2m◻[22m [2m@scope/b[22m | ||
[36m│[39m [2m└ [22m[2m◻[22m [2m@scope/c[22m | ||
[36m│[39m [2m[22m[2m◻[22m [2munchanged packages[22m | ||
[36m│[39m [2m│ [22m[2m◻[22m [2m@scope/x[22m | ||
[36m│[39m [2m│ [22m[2m◻[22m [2m@scope/y[22m | ||
[36m│[39m [2m└ [22m[2m◻[22m [2m@scope/z[22m | ||
[36m└[39m | ||
" | ||
`; | ||
|
||
exports[`groupMultiselect should render initial state with option not active and selected 1`] = ` | ||
"[90m│[39m | ||
[36m◆[39m test message | ||
[36m│[39m [2m[22m[2m◻[22m [2mchanged packages[22m | ||
[36m│[39m [2m│ [22m[32m◼[39m [2m@scope/a[22m | ||
[36m│[39m [2m│ [22m[36m◻[39m @scope/b | ||
[36m│[39m [2m└ [22m[2m◻[22m [2m@scope/c[22m | ||
[36m│[39m [2m[22m[2m◻[22m [2munchanged packages[22m | ||
[36m│[39m [2m│ [22m[2m◻[22m [2m@scope/x[22m | ||
[36m│[39m [2m│ [22m[2m◻[22m [2m@scope/y[22m | ||
[36m│[39m [2m└ [22m[2m◻[22m [2m@scope/z[22m | ||
[36m└[39m | ||
" | ||
`; | ||
|
||
exports[`groupMultiselect should render initial with group active 1`] = ` | ||
"[90m│[39m | ||
[36m◆[39m test message | ||
[36m│[39m [2m[22m[36m◻[39m changed packages | ||
[36m│[39m │ [36m◻[39m [2m@scope/a[22m | ||
[36m│[39m │ [36m◻[39m [2m@scope/b[22m | ||
[36m│[39m └ [36m◻[39m [2m@scope/c[22m | ||
[36m│[39m [2m[22m[2m◻[22m [2munchanged packages[22m | ||
[36m│[39m [2m│ [22m[2m◻[22m [2m@scope/x[22m | ||
[36m│[39m [2m│ [22m[2m◻[22m [2m@scope/y[22m | ||
[36m│[39m [2m└ [22m[2m◻[22m [2m@scope/z[22m | ||
[36m└[39m | ||
" | ||
`; | ||
|
||
exports[`groupMultiselect should render initial with group selected 1`] = ` | ||
"[90m│[39m | ||
[36m◆[39m test message | ||
[36m│[39m [2m[22m[32m◼[39m changed packages | ||
[36m│[39m │ [32m◼[39m [2m@scope/a[22m | ||
[36m│[39m │ [32m◼[39m [2m@scope/b[22m | ||
[36m│[39m └ [32m◼[39m [2m@scope/c[22m | ||
[36m│[39m [2m[22m[2m◻[22m [2munchanged packages[22m | ||
[36m│[39m [2m│ [22m[2m◻[22m [2m@scope/x[22m | ||
[36m│[39m [2m│ [22m[2m◻[22m [2m@scope/y[22m | ||
[36m│[39m [2m└ [22m[2m◻[22m [2m@scope/z[22m | ||
[36m└[39m | ||
" | ||
`; |
32 changes: 32 additions & 0 deletions
32
packages/prompts/__tests__/prompts/__snapshots__/multiselect.spec.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`multiselect should render error 1`] = ` | ||
"[90m│[39m | ||
[33m▲[39m test message | ||
[33m│[39m [36m◻[39m foo | ||
[33m│[39m [2m◻[22m [2mbar[22m | ||
[33m│[39m [2m◻[22m [2mbaz[22m | ||
[33m└[39m [33mPlease select at least one option.[39m | ||
[8m-[28m [0m[2mPress [90m[47m[7m space [27m[49m[39m to select, [90m[47m[7m enter [27m[49m[39m to submit[22m[0m | ||
" | ||
`; | ||
|
||
exports[`multiselect should render initial state 1`] = ` | ||
"[90m│[39m | ||
[36m◆[39m test message | ||
[36m│[39m [36m◻[39m foo | ||
[36m│[39m [2m◻[22m [2mbar[22m | ||
[36m│[39m [2m◻[22m [2mbaz[22m | ||
[36m└[39m | ||
" | ||
`; | ||
|
||
exports[`multiselect should render initial state with initialValue 1`] = ` | ||
"[90m│[39m | ||
[36m◆[39m test message | ||
[36m│[39m [32m◼[39m [2mfoo[22m | ||
[36m│[39m [32m◼[39m bar | ||
[36m│[39m [2m◻[22m [2mbaz[22m | ||
[36m└[39m | ||
" | ||
`; |
21 changes: 21 additions & 0 deletions
21
packages/prompts/__tests__/prompts/__snapshots__/select-key.spec.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`selectKey should render initial state 1`] = ` | ||
"[90m│[39m | ||
[36m◆[39m test message | ||
[36m│[39m [46m[90m a [39m[49m a | ||
[36m│[39m [90m[47m[7m b [27m[49m[39m b | ||
[36m│[39m [90m[47m[7m c [27m[49m[39m c | ||
[36m└[39m | ||
" | ||
`; | ||
|
||
exports[`selectKey should render initial state with initialValue 1`] = ` | ||
"[90m│[39m | ||
[36m◆[39m test message | ||
[36m│[39m [90m[47m[7m a [27m[49m[39m a | ||
[36m│[39m [46m[90m b [39m[49m b | ||
[36m│[39m [90m[47m[7m c [27m[49m[39m c | ||
[36m└[39m | ||
" | ||
`; |
21 changes: 21 additions & 0 deletions
21
packages/prompts/__tests__/prompts/__snapshots__/select.spec.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`select should render initial state 1`] = ` | ||
"[90m│[39m | ||
[36m◆[39m test message | ||
[36m│[39m [32m●[39m foo | ||
[36m│[39m [2m○[22m [2mbar[22m | ||
[36m│[39m [2m○[22m [2mbaz[22m | ||
[36m└[39m | ||
" | ||
`; | ||
|
||
exports[`select should render initial state with initialValue 1`] = ` | ||
"[90m│[39m | ||
[36m◆[39m test message | ||
[36m│[39m [2m○[22m [2mfoo[22m | ||
[36m│[39m [32m●[39m bar | ||
[36m│[39m [2m○[22m [2mbaz[22m | ||
[36m└[39m | ||
" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.