Merge pull request #26085 from backstage/rugvip/cleanup
frontend-test-utils: remove dead code
This commit is contained in:
@@ -368,62 +368,4 @@ describe('createExtensionTester', () => {
|
||||
|
||||
expect([test, test2, test3]).toBeDefined();
|
||||
});
|
||||
|
||||
// TODO: this should be implemented
|
||||
// eslint-disable-next-line jest/no-disabled-tests
|
||||
it.skip('should allow querying an extension and getting outputs', () => {
|
||||
const extension = createExtension({
|
||||
namespace: 'test',
|
||||
name: 'e1',
|
||||
attachTo: { id: 'ignored', input: 'ignored' },
|
||||
output: [stringDataRef],
|
||||
inputs: {
|
||||
input: createExtensionInput([stringDataRef], { singleton: true }),
|
||||
},
|
||||
factory: ({ inputs }) => [
|
||||
stringDataRef(`nest-${inputs.input.get(stringDataRef)}`),
|
||||
],
|
||||
});
|
||||
|
||||
const extension2 = createExtension({
|
||||
namespace: 'test',
|
||||
name: 'e2',
|
||||
attachTo: { id: 'test/e1', input: 'blob' },
|
||||
output: [stringDataRef],
|
||||
factory: () => [stringDataRef('test-text')],
|
||||
});
|
||||
|
||||
const tester = createExtensionTester(extension).add(extension2);
|
||||
|
||||
expect(tester.query(extension).get(stringDataRef)).toBe('nest-test-text');
|
||||
expect(tester.query(extension2).get(stringDataRef)).toBe('test-text');
|
||||
// @ts-expect-error
|
||||
expect(tester.query(extension).input('input').data(stringDataRef)).toBe(
|
||||
'nest-test-text',
|
||||
);
|
||||
});
|
||||
|
||||
// TODO: this should be implemented
|
||||
// eslint-disable-next-line jest/no-disabled-tests
|
||||
it.skip('should allow defining inputs to extensions without a corresponding extension definition', () => {
|
||||
const extension = createExtension({
|
||||
namespace: 'test',
|
||||
name: 'e1',
|
||||
attachTo: { id: 'ignored', input: 'ignored' },
|
||||
output: [stringDataRef],
|
||||
inputs: {
|
||||
input: createExtensionInput([stringDataRef], { singleton: true }),
|
||||
},
|
||||
factory: ({ inputs }) => [
|
||||
stringDataRef(`nest-${inputs.input.get(stringDataRef)}`),
|
||||
],
|
||||
});
|
||||
|
||||
const tester = createExtensionTester(extension, {
|
||||
// @ts-expect-error
|
||||
inputs: { input: 'test-text' },
|
||||
});
|
||||
|
||||
expect(tester.query(extension).get(stringDataRef)).toBe('nest-test-text');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user