File tree Expand file tree Collapse file tree
packages/b2c-cli/test/commands/scapi/schemas Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 */
66import { runCommand } from '@oclif/test' ;
77import { expect } from 'chai' ;
8+ import { createIsolatedEnvHooks } from '../../../helpers/test-setup.js' ;
89
910describe ( 'scapi schemas get' , ( ) => {
11+ const hooks = createIsolatedEnvHooks ( ) ;
12+
13+ beforeEach ( hooks . beforeEach ) ;
14+
15+ afterEach ( hooks . afterEach ) ;
16+
1017 it ( 'shows help without errors' , async ( ) => {
1118 const { error} = await runCommand ( 'scapi schemas get --help' ) ;
1219 expect ( error ) . to . be . undefined ;
1320 } ) ;
1421
1522 it ( 'requires tenant-id flag' , async ( ) => {
16- const { error} = await runCommand ( 'scapi schemas get shopper products v1' ) ;
23+ // Provide mock OAuth credentials so we get past OAuth validation to tenant-id validation
24+ const { error} = await runCommand (
25+ 'scapi schemas get shopper products v1 --client-id test-client --short-code testcode' ,
26+ ) ;
1727 expect ( error ) . to . not . be . undefined ;
1828 expect ( error ?. message ) . to . include ( 'tenant-id' ) ;
1929 } ) ;
Original file line number Diff line number Diff line change 55 */
66import { runCommand } from '@oclif/test' ;
77import { expect } from 'chai' ;
8+ import { createIsolatedEnvHooks } from '../../../helpers/test-setup.js' ;
89
910describe ( 'scapi schemas list' , ( ) => {
11+ const hooks = createIsolatedEnvHooks ( ) ;
12+
13+ beforeEach ( hooks . beforeEach ) ;
14+
15+ afterEach ( hooks . afterEach ) ;
16+
1017 it ( 'shows help without errors' , async ( ) => {
1118 const { error} = await runCommand ( 'scapi schemas list --help' ) ;
1219 expect ( error ) . to . be . undefined ;
1320 } ) ;
1421
1522 it ( 'requires tenant-id flag' , async ( ) => {
16- const { error} = await runCommand ( 'scapi schemas list' ) ;
23+ // Provide mock OAuth credentials so we get past OAuth validation to tenant-id validation
24+ const { error} = await runCommand ( 'scapi schemas list --client-id test-client --short-code testcode' ) ;
1725 expect ( error ) . to . not . be . undefined ;
1826 expect ( error ?. message ) . to . include ( 'tenant-id' ) ;
1927 } ) ;
You can’t perform that action at this time.
0 commit comments