Skip to content

Commit 7c87b46

Browse files
committed
Make local formgrader UI test more consistent
The test formerly relied on a normal directory being missing. This commit uses /dev/null as the exchange directory to ensure it will always be missing.
1 parent 09716d1 commit 7c87b46

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

nbgrader/tests/ui-tests/formgrader.spec.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,7 @@ test.describe('#localFormgrader', () => {
956956
'#jp-mainmenu-nbgrader li[data-command="nbgrader:open-formgrader-local"]'
957957
);
958958

959+
// Ensure that the local formgrader setting is checked.
959960
const [settings, settingsTab] = await openSettings(page);
960961
const formgraderSettings = settings.locator(
961962
'.jp-PluginList-entry[data-id="@jupyter/nbgrader:formgrader"]'
@@ -970,6 +971,9 @@ test.describe('#localFormgrader', () => {
970971
await expect(settingsTab).toHaveAttribute('class', /jp-mod-dirty/);
971972
await expect(settingsTab).not.toHaveAttribute('class', /jp-mod-dirty/);
972973

974+
// Make sure the global nbgrader exchange and cache directories are junk
975+
createEnv(testDir, "tmpPath", "/dev/null", "/dev/null", isWindows);
976+
973977
// Add a local formgrader in another directory
974978
const newDirectory = path.resolve(testDir, 'localFormgrader');
975979

@@ -979,7 +983,7 @@ test.describe('#localFormgrader', () => {
979983
fs.mkdirSync(newDirectory);
980984
fs.copyFileSync(
981985
path.resolve(testDir, "nbgrader_config.py"),
982-
path.resolve(testDir, tmpPath, "nbgrader_config.py")
986+
path.resolve(newDirectory, "nbgrader_config.py")
983987
);
984988

985989
var text_to_append = `

0 commit comments

Comments
 (0)