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:
Kim Santiago
2020-06-30 13:42:50 -07:00
committed by GitHub
parent b875d919d2
commit 41315c6e0a
5 changed files with 131 additions and 23 deletions

View File

@@ -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> {