jsOMS/tests/Asset/AssetManagerTest.js
Dennis Eichhorn d2e2bf97df general fixes
2024-04-19 02:08:38 +00:00

32 lines
970 B
JavaScript
Executable File

import { AssetManager } from '../../Asset/AssetManager.js';
describe('AssetManagerTest', function ()
{
'use strict';
describe('testDefault', function ()
{
it('Testing default functionality', function ()
{
let asset = new AssetManager();
expect(asset.get('invalid')).toBe(null);
expect(asset.remove('invalid')).toBeFalsy();
});
});
describe('testAssetInteraction', function ()
{
it('Testing asset interaction functionality', function ()
{
let asset = new AssetManager(),
base = window.location.href.substr(0, window.location.href.length - 15);
asset.registerLoadedAssets();
expect(asset.get(base + '../Utils/oLib.js')).not.toBe(null);
expect(asset.remove(base + '../Utils/oLib.js')).toBeTruthy();
expect(asset.load(base + '../Utils/oLib.js', 'js')).not.toBeFalsy();
});
});
});