@@ -561,36 +561,6 @@ describe('DefaultWorkflowRunner', () => {
|
||||
|
||||
describe('user', () => {
|
||||
it('allows access to the user entity at the templating level', async () => {
|
||||
const task = createMockTaskWithSpec({
|
||||
apiVersion: 'scaffolder.backstage.io/v1beta3',
|
||||
steps: [
|
||||
{
|
||||
id: 'test',
|
||||
name: 'name',
|
||||
action: 'output-action',
|
||||
input: {},
|
||||
},
|
||||
],
|
||||
output: {
|
||||
foo: '${{ parameters.repoUrl | parseRepoUrl }}',
|
||||
},
|
||||
parameters: {
|
||||
repoUrl: 'github.com?repo=repo&owner=owner',
|
||||
},
|
||||
});
|
||||
|
||||
const { output } = await runner.execute(task);
|
||||
|
||||
expect(output.foo).toEqual({
|
||||
host: 'github.com',
|
||||
owner: 'owner',
|
||||
repo: 'repo',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('filters', () => {
|
||||
it('provides the parseRepoUrl filter', async () => {
|
||||
const task = createMockTaskWithSpec({
|
||||
apiVersion: 'scaffolder.backstage.io/v1beta3',
|
||||
steps: [
|
||||
@@ -618,4 +588,34 @@ describe('DefaultWorkflowRunner', () => {
|
||||
expect(output.foo).toEqual('bob user:default/guest');
|
||||
});
|
||||
});
|
||||
|
||||
describe('filters', () => {
|
||||
it('provides the parseRepoUrl filter', async () => {
|
||||
const task = createMockTaskWithSpec({
|
||||
apiVersion: 'scaffolder.backstage.io/v1beta3',
|
||||
steps: [
|
||||
{
|
||||
id: 'test',
|
||||
name: 'name',
|
||||
action: 'output-action',
|
||||
input: {},
|
||||
},
|
||||
],
|
||||
output: {
|
||||
foo: '${{ parameters.repoUrl | parseRepoUrl }}',
|
||||
},
|
||||
parameters: {
|
||||
repoUrl: 'github.com?repo=repo&owner=owner',
|
||||
},
|
||||
});
|
||||
|
||||
const { output } = await runner.execute(task);
|
||||
|
||||
expect(output.foo).toEqual({
|
||||
host: 'github.com',
|
||||
owner: 'owner',
|
||||
repo: 'repo',
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user