mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
update sql projects test (#17987)
This commit is contained in:
@@ -660,6 +660,8 @@ export class ProjectsController {
|
||||
if (root && fileOrFolder) {
|
||||
// use relative path and not tree paths for files and folder
|
||||
const allFileEntries = project.files.concat(project.preDeployScripts).concat(project.postDeployScripts).concat(project.noneDeployScripts);
|
||||
|
||||
// trim trailing slash since folders with and without a trailing slash are allowed in a sqlproj
|
||||
const trimmedUri = utils.trimChars(utils.getPlatformSafeFileEntryPath(utils.trimUri(root.fileSystemUri, fileOrFolder.fileSystemUri)), '/');
|
||||
return allFileEntries.find(x => utils.trimChars(utils.getPlatformSafeFileEntryPath(x.relativePath), '/') === trimmedUri);
|
||||
}
|
||||
|
||||
@@ -108,11 +108,10 @@ describe('Project Tree tests', function (): void {
|
||||
'/TestProj/Database References',
|
||||
'/TestProj/someFolder1']);
|
||||
|
||||
// Why are we only matching names - https://github.com/microsoft/azuredatastudio/issues/11026
|
||||
should(tree.children.find(x => x.projectUri.path === '/TestProj/someFolder1')?.children.map(y => path.basename(y.projectUri.path))).deepEqual([
|
||||
'MyNestedFolder1',
|
||||
'MyNestedFolder2',
|
||||
'MyFile2.sql']);
|
||||
should(tree.children.find(x => x.projectUri.path === '/TestProj/someFolder1')?.children.map(y => y.projectUri.path)).deepEqual([
|
||||
'/TestProj/someFolder1/MyNestedFolder1',
|
||||
'/TestProj/someFolder1/MyNestedFolder2',
|
||||
'/TestProj/someFolder1/MyFile2.sql']);
|
||||
});
|
||||
|
||||
it('Should be able to parse and include relative paths outside project folder', function (): void {
|
||||
|
||||
Reference in New Issue
Block a user