mirror of
https://github.com/HeyPuter/puter.git
synced 2026-08-28 17:07:16 +00:00
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:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user