mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-01-11 17:58:41 +00:00
More test implementations
This commit is contained in:
parent
d9673b5ba4
commit
ff5540e6f6
|
|
@ -24,11 +24,6 @@
|
|||
this.status = status;
|
||||
};
|
||||
|
||||
requestPermission ()
|
||||
{
|
||||
const self = this;
|
||||
};
|
||||
|
||||
send (msg)
|
||||
{
|
||||
const tpl = document.getElementById('app-message');
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@
|
|||
<script>
|
||||
jsOMS = {};
|
||||
</script>
|
||||
<script src="../../../../jsOMS/Chart/Position.enum.js"></script>
|
||||
<script src="../../../../jsOMS/Chart/Position.js"></script>
|
||||
<script src="../../../../jsOMS/Chart/Chart.js"></script>
|
||||
|
||||
<body>
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@
|
|||
<script>
|
||||
jsOMS = {};
|
||||
</script>
|
||||
<script src="../../../../jsOMS/Chart/Position.enum.js"></script>
|
||||
<script src="../../../../jsOMS/Chart/Position.js"></script>
|
||||
<script src="../../../../jsOMS/Chart/Chart.js"></script>
|
||||
|
||||
<body>
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@
|
|||
<script>
|
||||
jsOMS = {};
|
||||
</script>
|
||||
<script src="../../../../jsOMS/Chart/Position.enum.js"></script>
|
||||
<script src="../../../../jsOMS/Chart/Position.js"></script>
|
||||
<script src="../../../../jsOMS/Chart/Chart.js"></script>
|
||||
|
||||
<body>
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@
|
|||
<script>
|
||||
jsOMS = {};
|
||||
</script>
|
||||
<script src="../../../../jsOMS/Chart/Position.enum.js"></script>
|
||||
<script src="../../../../jsOMS/Chart/Position.js"></script>
|
||||
<script src="../../../../jsOMS/Chart/Chart.js"></script>
|
||||
|
||||
<body>
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
describe('AppNotificationTest', function ()
|
||||
{
|
||||
"use strict";
|
||||
|
||||
beforeEach(function ()
|
||||
{
|
||||
});
|
||||
|
||||
afterEach(function ()
|
||||
{
|
||||
});
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
describe('BrowserNotificationTest', function ()
|
||||
{
|
||||
"use strict";
|
||||
|
||||
beforeEach(function ()
|
||||
{
|
||||
});
|
||||
|
||||
afterEach(function ()
|
||||
{
|
||||
});
|
||||
}
|
||||
20
tests/Message/Notification/NotificationLevelTest.js
Normal file
20
tests/Message/Notification/NotificationLevelTest.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
describe('NotificationLevelTest', function ()
|
||||
{
|
||||
"use strict";
|
||||
|
||||
describe('testEnum', function ()
|
||||
{
|
||||
it('Testing amount of enums', function ()
|
||||
{
|
||||
expect(Object.keys(jsOMS.Message.Notification.NotificationLevel).length).toBe(4);
|
||||
});
|
||||
|
||||
it('Testing values of enums', function ()
|
||||
{
|
||||
expect(jsOMS.Message.Notification.NotificationLevel.OK).toBe('ok');
|
||||
expect(jsOMS.Message.Notification.NotificationLevel.INFO).toBe('info');
|
||||
expect(jsOMS.Message.Notification.NotificationLevel.WARNING).toBe('warning');
|
||||
expect(jsOMS.Message.Notification.NotificationLevel.ERROR).toBe('error');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
@ -2,11 +2,14 @@ describe('NotificationManagerTest', function ()
|
|||
{
|
||||
"use strict";
|
||||
|
||||
beforeEach(function ()
|
||||
describe('testDefault', function ()
|
||||
{
|
||||
it('Testing default functionality', function ()
|
||||
{
|
||||
let manager = new jsOMS.Message.Notification.NotificationManager();
|
||||
|
||||
expect(manager.getAppNotifier()).toEqual(jasmine.any(jsOMS.Message.Notification.App.AppNotification));
|
||||
expect(manager.getBrowserNotifier()).toEqual(jasmine.any(jsOMS.Message.Notification.Browser.BrowserNotification));
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(function ()
|
||||
{
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -2,11 +2,15 @@ describe('NotificationMessageTest', function ()
|
|||
{
|
||||
"use strict";
|
||||
|
||||
beforeEach(function ()
|
||||
describe('testDefault', function ()
|
||||
{
|
||||
it('Testing default functionality', function ()
|
||||
{
|
||||
let msg = new jsOMS.Message.Notification.NotificationMessage('ok', 'abc', 'def');
|
||||
|
||||
expect(msg.status).toBe('ok');
|
||||
expect(msg.title).toBe('abc');
|
||||
expect(msg.message).toBe('def');
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(function ()
|
||||
{
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
describe('NotificationTypeTest', function ()
|
||||
{
|
||||
"use strict";
|
||||
|
||||
beforeEach(function ()
|
||||
{
|
||||
});
|
||||
|
||||
afterEach(function ()
|
||||
{
|
||||
});
|
||||
}
|
||||
18
tests/Message/Notification/NotificationTypeTest.js
Normal file
18
tests/Message/Notification/NotificationTypeTest.js
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
describe('NotificationTypeTest', function ()
|
||||
{
|
||||
"use strict";
|
||||
|
||||
describe('testEnum', function ()
|
||||
{
|
||||
it('Testing amount of enums', function ()
|
||||
{
|
||||
expect(Object.keys(jsOMS.Message.Notification.NotificationType).length).toBe(2);
|
||||
});
|
||||
|
||||
it('Testing values of enums', function ()
|
||||
{
|
||||
expect(jsOMS.Message.Notification.NotificationType.APP_NOTIFICATION).toBe(1);
|
||||
expect(jsOMS.Message.Notification.NotificationType.BROWSER_NOTIFICATION).toBe(2);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
@ -35,6 +35,13 @@
|
|||
<script src="../Event/EventManager.js"></script>
|
||||
<script src="../Math/MathProcessor.js"></script>
|
||||
|
||||
<script src="../Message/Notification/NotificationLevel.js"></script>
|
||||
<script src="../Message/Notification/NotificationType.js"></script>
|
||||
<script src="../Message/Notification/NotificationMessage.js"></script>
|
||||
<script src="../Message/Notification/App/AppNotification.js"></script>
|
||||
<script src="../Message/Notification/Browser/BrowserNotification.js"></script>
|
||||
<script src="../Message/Notification/NotificationManager.js"></script>
|
||||
|
||||
<script src="../Uri/Http.js"></script>
|
||||
<script src="../Uri/UriFactory.js"></script>
|
||||
|
||||
|
|
@ -53,6 +60,11 @@
|
|||
<script src="Event/EventManagerTest.js"></script>
|
||||
<script src="Math/MathProcessorTest.js"></script>
|
||||
|
||||
<script src="Message/Notification/NotificationLevelTest.js"></script>
|
||||
<script src="Message/Notification/NotificationTypeTest.js"></script>
|
||||
<script src="Message/Notification/NotificationMessageTest.js"></script>
|
||||
<script src="Message/Notification/NotificationManagerTest.js"></script>
|
||||
|
||||
<script src="Uri/HttpTest.js"></script>
|
||||
<script src="Uri/UriFactoryTest.js"></script>
|
||||
</head>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user