Update apps tests for extension canonicalization

Adjust apps API tests to match current normalization behavior for `filetypeAssociations`: extension values are stored as lowercase bare extensions (e.g. `.txt` -> `txt`), while MIME types remain unchanged. Added inline comments in both test suites to document this expected remap.
This commit is contained in:
jelveh
2026-07-30 12:57:46 -07:00
parent ae779e5a7e
commit 6dc448d5ed
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -37,7 +37,9 @@ window.appsTests = [
});
const fetched = await puter.apps.get(name);
assert(Boolean(fetched.maximize_on_start) === true, "maximize_on_start not stored");
assert(JSON.stringify(fetched.filetype_associations) === JSON.stringify(['.txt', 'image/png']), "filetype_associations not stored");
// Extensions are canonicalized to the bare lowercase form on
// write ('.txt' → 'txt'); MIME types pass through unchanged.
assert(JSON.stringify(fetched.filetype_associations) === JSON.stringify(['txt', 'image/png']), "filetype_associations not stored");
pass("testCreateOptionsRemap passed");
} catch (error) {
fail("testCreateOptionsRemap failed:", error);
+3 -1
View File
@@ -222,7 +222,9 @@ export default suite('apps', {
maximizeOnStart: true,
});
const fetched = await t.puter.apps.get('apps-suite-remap');
t.assert.deepEqual(fetched.filetype_associations, ['.txt', 'image/png']);
// Extensions are canonicalized to the bare lowercase form on write
// ('.txt' → 'txt'); MIME-type associations pass through unchanged.
t.assert.deepEqual(fetched.filetype_associations, ['txt', 'image/png']);
t.assert.equal(Boolean(fetched.maximize_on_start), true);
},
});