feat(scaffolder): implement scaffolderServiceRef for credentials aware communication (#33044)
* add scaffolderServiceRef to scaffolder-node Signed-off-by: benjdlambert <ben@blam.sh> * make ScaffolderApi methods required, add tests Signed-off-by: benjdlambert <ben@blam.sh> * use request objects for single-string params in ScaffolderService Signed-off-by: benjdlambert <ben@blam.sh> * add scaffolderServiceMock test utility Signed-off-by: benjdlambert <ben@blam.sh> * adjust review comments Signed-off-by: benjdlambert <ben@blam.sh> * add scaffolderApiMock test utility to scaffolder-react Signed-off-by: benjdlambert <ben@blam.sh> * use items/totalItems response shape for listTasks Signed-off-by: benjdlambert <ben@blam.sh> * pass credentials through for autocomplete Signed-off-by: benjdlambert <ben@blam.sh> --------- Signed-off-by: benjdlambert <ben@blam.sh>
This commit is contained in:
+3
@@ -38,6 +38,9 @@ describe('TemplateEditorToolbar', () => {
|
||||
listActions: jest.fn(),
|
||||
listTasks: jest.fn(),
|
||||
autocomplete: jest.fn(),
|
||||
retry: jest.fn(),
|
||||
listTemplatingExtensions: jest.fn(),
|
||||
dryRun: jest.fn(),
|
||||
};
|
||||
|
||||
scaffolderApiMock.listActions.mockResolvedValue([
|
||||
|
||||
@@ -54,6 +54,9 @@ const scaffolderApiMock: jest.Mocked<ScaffolderApi> = {
|
||||
listActions: jest.fn(),
|
||||
listTasks: jest.fn(),
|
||||
autocomplete: jest.fn(),
|
||||
retry: jest.fn(),
|
||||
listTemplatingExtensions: jest.fn(),
|
||||
dryRun: jest.fn(),
|
||||
};
|
||||
|
||||
const scaffolderDecoratorsMock: jest.Mocked<ScaffolderFormDecoratorsApi> = {
|
||||
|
||||
@@ -34,6 +34,9 @@ const scaffolderApiMock: jest.Mocked<ScaffolderApi> = {
|
||||
listActions: jest.fn(),
|
||||
listTasks: jest.fn(),
|
||||
autocomplete: jest.fn(),
|
||||
retry: jest.fn(),
|
||||
listTemplatingExtensions: jest.fn(),
|
||||
dryRun: jest.fn(),
|
||||
};
|
||||
|
||||
const mockPermissionApi = { authorize: jest.fn() };
|
||||
|
||||
+2
@@ -40,6 +40,8 @@ const scaffolderApiMock: jest.Mocked<ScaffolderApi> = {
|
||||
listTemplatingExtensions,
|
||||
listTasks: jest.fn(),
|
||||
autocomplete: jest.fn(),
|
||||
retry: jest.fn(),
|
||||
dryRun: jest.fn(),
|
||||
};
|
||||
|
||||
const mockPermissionApi = { authorize: jest.fn() };
|
||||
|
||||
Reference in New Issue
Block a user