Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 30 additions & 5 deletions openmetadata-ui/src/main/resources/ui/src/rest/testAPI.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ describe('testAPI tests', () => {
});

describe('getTestSuiteByName', () => {
it('should fetch test suite by name with params', async () => {
it('should default owners/experts to non-deleted so soft-deleted owners stay hidden (issue #30117)', async () => {
const mockGet = jest.fn().mockResolvedValue({ data: mockTestSuite });
jest.mock('./index', () => ({
__esModule: true,
Expand All @@ -894,17 +894,42 @@ describe('testAPI tests', () => {

const { getTestSuiteByName } = require('./testAPI');

const params = { fields: ['owners', 'tests'] };

const result = await getTestSuiteByName('test.suite.name', params);
const result = await getTestSuiteByName('test.suite.name', {
fields: ['owners', 'tests'],
});

expect(mockGet).toHaveBeenCalledWith(
expect.stringContaining('/dataQuality/testSuites/name/'),
{ params }
{
params: {
fields: ['owners', 'tests'],
includeRelations: 'owners:non-deleted,experts:non-deleted',
},
}
);
expect(result).toEqual(mockTestSuite);
});

it('should respect a caller-provided includeRelations', async () => {
const mockGet = jest.fn().mockResolvedValue({ data: mockTestSuite });
jest.mock('./index', () => ({
__esModule: true,
default: {
get: mockGet,
},
}));

const { getTestSuiteByName } = require('./testAPI');

await getTestSuiteByName('test.suite.name', {
includeRelations: 'owners:all',
});

expect(mockGet).toHaveBeenCalledWith(expect.any(String), {
params: { includeRelations: 'owners:all' },
});
});

it('should encode FQN with special characters', async () => {
const mockGet = jest.fn().mockResolvedValue({ data: mockTestSuite });
jest.mock('./index', () => ({
Expand Down
12 changes: 11 additions & 1 deletion openmetadata-ui/src/main/resources/ui/src/rest/testAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,17 @@ export const getTestSuiteByName = async (
) => {
const response = await APIClient.get<TestSuite>(
`${testSuiteUrl}/name/${getEncodedFqn(name)}`,
{ params }
{
// Resolve owners/experts as non-deleted (consistent with data-asset detail pages), so a
// soft-deleted owner is not surfaced and the owner-edit diff stays aligned with the server's
// NON_DELETED PATCH base - otherwise a positional patch throws "array item index out of
// range". See issue #30117.
params: {
...params,
includeRelations:
params?.includeRelations ?? 'owners:non-deleted,experts:non-deleted',
},
Comment on lines +421 to +425
}
);

return response.data;
Expand Down
Loading