-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow dragging sas content into editor (#510)
**Summary** This adds the ability to drag sas content into sas programs. See #329 for more details **Testing** - [x] Tested dragging a folder into a SAS program (should not provide any code) - [x] Tested dragging a file into a SAS program from my folder - [x] Tested dragging a file into a SAS program from my favorites - [x] Tested dragging files into a SAS program from nested folder paths - [x] Tested dragging two files from the same folder into a SAS program
- Loading branch information
1 parent
bf30847
commit 4c172f6
Showing
5 changed files
with
178 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { expect } from "chai"; | ||
|
||
import { getFileStatement } from "../../../src/components/ContentNavigator/utils"; | ||
|
||
describe("utils", async function () { | ||
it("getFileStatement - returns extensionless name + numeric suffix with no content", () => { | ||
expect(getFileStatement("testcsv.csv", "", "/path").value).to.equal( | ||
`filename \${1:fileref} filesrvc folderpath='/path' filename='testcsv.csv';\n`, | ||
); | ||
}); | ||
|
||
it("getFileStatement - returns uppercase name + suffix with uppercase content", () => { | ||
expect( | ||
getFileStatement("testcsv.csv", "UPPER CASE CONTENT", "/path").value, | ||
).to.equal( | ||
`FILENAME \${1:FILEREF} FILESRVC FOLDERPATH='/path' FILENAME='testcsv.csv';\n`, | ||
); | ||
}); | ||
|
||
it("getFileStatement - returns encoded filename when filename contains quotes", () => { | ||
expect( | ||
getFileStatement("testcsv-'withquotes'.csv", "", "/path").value, | ||
).to.equal( | ||
`filename \${1:fileref} filesrvc folderpath='/path' filename='testcsv-''withquotes''.csv';\n`, | ||
); | ||
}); | ||
}); |