global.namespace.tests.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. describe('Chart namespace', function() {
  2. describe('Chart', function() {
  3. it('should a function (constructor)', function() {
  4. expect(Chart instanceof Function).toBeTruthy();
  5. });
  6. it('should define "core" properties', function() {
  7. expect(Chart instanceof Function).toBeTruthy();
  8. expect(Chart.Animation instanceof Object).toBeTruthy();
  9. expect(Chart.animationService instanceof Object).toBeTruthy();
  10. expect(Chart.defaults instanceof Object).toBeTruthy();
  11. expect(Chart.Element instanceof Object).toBeTruthy();
  12. expect(Chart.Interaction instanceof Object).toBeTruthy();
  13. expect(Chart.layouts instanceof Object).toBeTruthy();
  14. expect(Chart.plugins instanceof Object).toBeTruthy();
  15. expect(Chart.platform instanceof Object).toBeTruthy();
  16. expect(Chart.Scale instanceof Object).toBeTruthy();
  17. expect(Chart.scaleService instanceof Object).toBeTruthy();
  18. expect(Chart.Ticks instanceof Object).toBeTruthy();
  19. expect(Chart.Tooltip instanceof Object).toBeTruthy();
  20. expect(Chart.Tooltip.positioners instanceof Object).toBeTruthy();
  21. });
  22. });
  23. describe('Chart.elements', function() {
  24. it('should be an object', function() {
  25. expect(Chart.elements instanceof Object).toBeTruthy();
  26. });
  27. it('should contains "elements" classes', function() {
  28. expect(Chart.elements.Arc instanceof Function).toBeTruthy();
  29. expect(Chart.elements.Line instanceof Function).toBeTruthy();
  30. expect(Chart.elements.Point instanceof Function).toBeTruthy();
  31. expect(Chart.elements.Rectangle instanceof Function).toBeTruthy();
  32. });
  33. });
  34. describe('Chart.helpers', function() {
  35. it('should be an object', function() {
  36. expect(Chart.helpers instanceof Object).toBeTruthy();
  37. });
  38. it('should contains "helpers" namespaces', function() {
  39. expect(Chart.helpers.easing instanceof Object).toBeTruthy();
  40. expect(Chart.helpers.canvas instanceof Object).toBeTruthy();
  41. expect(Chart.helpers.options instanceof Object).toBeTruthy();
  42. });
  43. });
  44. });