mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-18 01:25:37 -05:00
Show error when trying to add file/folder that already exists to project (#11122)
* show error when trying to create file or folder that already exists * add test for file that already exists * add folder tests * fix error messages * hide Properties folder * update comment
This commit is contained in:
@@ -33,7 +33,7 @@ describe('Project: sqlproj content operations', function (): void {
|
||||
|
||||
// Files and folders
|
||||
should(project.files.filter(f => f.type === EntryType.File).length).equal(4);
|
||||
should(project.files.filter(f => f.type === EntryType.Folder).length).equal(5);
|
||||
should(project.files.filter(f => f.type === EntryType.Folder).length).equal(4);
|
||||
|
||||
should(project.files.find(f => f.type === EntryType.Folder && f.relativePath === 'Views\\User')).not.equal(undefined); // mixed ItemGroup folder
|
||||
should(project.files.find(f => f.type === EntryType.File && f.relativePath === 'Views\\User\\Profile.sql')).not.equal(undefined); // mixed ItemGroup file
|
||||
@@ -81,7 +81,7 @@ describe('Project: sqlproj content operations', function (): void {
|
||||
await project.addToProject(list);
|
||||
|
||||
should(project.files.filter(f => f.type === EntryType.File).length).equal(11); // txt file shouldn't be added to the project
|
||||
should(project.files.filter(f => f.type === EntryType.Folder).length).equal(3); // 2folders + default Properties folder
|
||||
should(project.files.filter(f => f.type === EntryType.Folder).length).equal(2); // 2 folders
|
||||
});
|
||||
|
||||
it('Should throw error while adding Folder and Build entries to sqlproj when a file/folder does not exist on disk', async function (): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user