Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -792,8 +792,8 @@ const viewSchema = inherit(baseSchema, {
Joi.array().items(Joi.alternatives([
Joi.string().required(),
Joi.object().keys({
name: Joi.string().required(),
alias: Joi.string()
name: identifier.required(),
alias: identifier
})
]))
]).required(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,37 @@ describe('Cube Validation', () => {
expect(validationResult.error).toBeFalsy();
});

it('view with incorrect included member with alias', async () => {
const cubeValidator = new CubeValidator(new CubeSymbols());
const cube = {
name: 'name',
// it's a hidden field which we use internally
isView: true,
fileName: 'fileName',
cubes: [
{
joinPath: () => '',
prefix: false,
includes: [
'member-by-name',
{
name: 'member-by-alias',
alias: 'incorrect Alias'
}
]
}
]
};

const validationResult = cubeValidator.validate(cube, {
error: (message: any, _e: any) => {
console.log(message);
}
} as any);

expect(validationResult.error).toBeTruthy();
});

it('refreshKey alternatives', async () => {
const cubeValidator = new CubeValidator(new CubeSymbols());
const cube = {
Expand Down
Loading