From c5de0131e077115361af05e35f8adbe2d1662855 Mon Sep 17 00:00:00 2001 From: StevanFreeborn Date: Thu, 26 Jan 2023 23:47:25 -0600 Subject: [PATCH] fix: add tests for enums --- src/enums/DataFormat.ts | 2 +- src/enums/FieldStatus.ts | 2 +- src/enums/FieldType.ts | 2 +- src/enums/FileStorageSite.ts | 2 +- src/enums/FormulaOutputType.ts | 2 +- src/enums/Multiplicity.ts | 2 +- src/enums/ReportDataType.ts | 2 +- src/enums/ResultValueType.ts | 2 +- src/enums/TimeSpanIncrement.ts | 2 +- ...ecurrence.ts => TimeSpanRecurrenceType.ts} | 2 +- tests/DataFormat.spec.ts | 18 ++++ tests/FieldStatus.spec.ts | 25 ++++++ tests/FieldType.spec.ts | 88 +++++++++++++++++++ tests/FileStorageSite.spec.ts | 25 ++++++ tests/FormulaOutputType.spec.ts | 32 +++++++ tests/Multiplicity.spec.ts | 18 ++++ tests/ReportDataType.spec.ts | 18 ++++ tests/ResultValueType.ts | 88 +++++++++++++++++++ tests/TimeSpanIncrement.spec.ts | 53 +++++++++++ tests/TimeSpanRecurrenceType.spec.ts | 25 ++++++ 20 files changed, 400 insertions(+), 10 deletions(-) rename src/enums/{TimeSpanRecurrence.ts => TimeSpanRecurrenceType.ts} (71%) create mode 100644 tests/DataFormat.spec.ts create mode 100644 tests/FieldStatus.spec.ts create mode 100644 tests/FieldType.spec.ts create mode 100644 tests/FileStorageSite.spec.ts create mode 100644 tests/FormulaOutputType.spec.ts create mode 100644 tests/Multiplicity.spec.ts create mode 100644 tests/ReportDataType.spec.ts create mode 100644 tests/ResultValueType.ts create mode 100644 tests/TimeSpanIncrement.spec.ts create mode 100644 tests/TimeSpanRecurrenceType.spec.ts diff --git a/src/enums/DataFormat.ts b/src/enums/DataFormat.ts index cd478d9..e468558 100644 --- a/src/enums/DataFormat.ts +++ b/src/enums/DataFormat.ts @@ -1,4 +1,4 @@ -enum DataFormat { +export enum DataFormat { Raw = 'Raw', Formatted = 'Formatted', } \ No newline at end of file diff --git a/src/enums/FieldStatus.ts b/src/enums/FieldStatus.ts index 3d374ef..f9890d2 100644 --- a/src/enums/FieldStatus.ts +++ b/src/enums/FieldStatus.ts @@ -1,4 +1,4 @@ -enum FieldStatus { +export enum FieldStatus { Enabled = 'Enabled', Disabled = 'Disabled', Invalid = 'Invalid', diff --git a/src/enums/FieldType.ts b/src/enums/FieldType.ts index cc0028b..b79587b 100644 --- a/src/enums/FieldType.ts +++ b/src/enums/FieldType.ts @@ -1,4 +1,4 @@ -enum FieldType { +export enum FieldType { Text = 'Text', Number = 'Number', AutoNumber = 'AutoNumber', diff --git a/src/enums/FileStorageSite.ts b/src/enums/FileStorageSite.ts index de1e40b..bf69f71 100644 --- a/src/enums/FileStorageSite.ts +++ b/src/enums/FileStorageSite.ts @@ -1,4 +1,4 @@ -enum FileStorageSite { +export enum FileStorageSite { Internal = 'Internal', OneDrive = 'OneDrive', GoogleDrive = 'GoogleDrive', diff --git a/src/enums/FormulaOutputType.ts b/src/enums/FormulaOutputType.ts index 5f8fd2e..2981177 100644 --- a/src/enums/FormulaOutputType.ts +++ b/src/enums/FormulaOutputType.ts @@ -1,4 +1,4 @@ -enum FormulaOutputType { +export enum FormulaOutputType { Text = 'Text', Numeric = 'Numeric', DateAndTime = 'DateAndTime', diff --git a/src/enums/Multiplicity.ts b/src/enums/Multiplicity.ts index 791503e..4e74c84 100644 --- a/src/enums/Multiplicity.ts +++ b/src/enums/Multiplicity.ts @@ -1,4 +1,4 @@ -enum Multiplicity { +export enum Multiplicity { SingleSelect = 'SingleSelect', MultiSelect = 'MultiSelect', } diff --git a/src/enums/ReportDataType.ts b/src/enums/ReportDataType.ts index 04d33ae..b0cd8e5 100644 --- a/src/enums/ReportDataType.ts +++ b/src/enums/ReportDataType.ts @@ -1,4 +1,4 @@ -enum ReportDataType { +export enum ReportDataType { ReportData = 'ReportData', ChartData = 'ChartData', } diff --git a/src/enums/ResultValueType.ts b/src/enums/ResultValueType.ts index 526efb0..52b3b57 100644 --- a/src/enums/ResultValueType.ts +++ b/src/enums/ResultValueType.ts @@ -1,4 +1,4 @@ -enum ResultValueType { +export enum ResultValueType { String = 'String', Integer = 'Integer', Decimal = 'Decimal', diff --git a/src/enums/TimeSpanIncrement.ts b/src/enums/TimeSpanIncrement.ts index b964bd2..3c07d6a 100644 --- a/src/enums/TimeSpanIncrement.ts +++ b/src/enums/TimeSpanIncrement.ts @@ -1,4 +1,4 @@ -enum TimeSpanIncrement { +export enum TimeSpanIncrement { Seconds = 'Seconds', Minutes = 'Minutes', Hours = 'Hours', diff --git a/src/enums/TimeSpanRecurrence.ts b/src/enums/TimeSpanRecurrenceType.ts similarity index 71% rename from src/enums/TimeSpanRecurrence.ts rename to src/enums/TimeSpanRecurrenceType.ts index eaba62e..2d52829 100644 --- a/src/enums/TimeSpanRecurrence.ts +++ b/src/enums/TimeSpanRecurrenceType.ts @@ -1,4 +1,4 @@ -enum TimeSpanRecurrenceType { +export enum TimeSpanRecurrenceType { None = 'None', EndByDate = 'EndByDate', EndAfterOccurrences = 'EndAfterOccurrences', diff --git a/tests/DataFormat.spec.ts b/tests/DataFormat.spec.ts new file mode 100644 index 0000000..a87d12d --- /dev/null +++ b/tests/DataFormat.spec.ts @@ -0,0 +1,18 @@ +import { DataFormat } from '../src/enums/DataFormat'; +import { expect } from 'chai'; + +describe('DataFormat', function () { + describe('Raw', function () { + it('should return the correct value', function () { + const result = DataFormat.Raw; + expect(result).to.equal('Raw'); + }); + }); + + describe('Formatted', function () { + it('should return the correct value', function () { + const result = DataFormat.Formatted; + expect(result).to.equal('Formatted'); + }); + }); +}); \ No newline at end of file diff --git a/tests/FieldStatus.spec.ts b/tests/FieldStatus.spec.ts new file mode 100644 index 0000000..0ecaf55 --- /dev/null +++ b/tests/FieldStatus.spec.ts @@ -0,0 +1,25 @@ +import { FieldStatus } from '../src/enums/FieldStatus'; +import { expect } from 'chai'; + +describe('FieldStatus', function () { + describe('Enabled', function () { + it('should return the correct value', function () { + const result = FieldStatus.Enabled; + expect(result).to.equal('Enabled'); + }); + }); + + describe('Disabled', function () { + it('should return the correct value', function () { + const result = FieldStatus.Disabled; + expect(result).to.equal('Disabled'); + }); + }); + + describe('Invalid', function () { + it('should return the correct value', function () { + const result = FieldStatus.Invalid; + expect(result).to.equal('Invalid'); + }); + }); +}); \ No newline at end of file diff --git a/tests/FieldType.spec.ts b/tests/FieldType.spec.ts new file mode 100644 index 0000000..722541e --- /dev/null +++ b/tests/FieldType.spec.ts @@ -0,0 +1,88 @@ +import { FieldType } from '../src/enums/FieldType'; +import { expect } from 'chai'; + +describe('FieldType', function () { + describe('Text', function () { + it('should return the correct value', function () { + const result = FieldType.Text; + expect(result).to.equal('Text'); + }); + }); + + describe('Number', function () { + it('should return the correct value', function () { + const result = FieldType.Number; + expect(result).to.equal('Number'); + }); + }); + + describe('AutoNumber', function () { + it('should return the correct value', function () { + const result = FieldType.AutoNumber; + expect(result).to.equal('AutoNumber'); + }); + }); + + describe('Date', function () { + it('should return the correct value', function () { + const result = FieldType.Date; + expect(result).to.equal('Date'); + }); + }); + + describe('TimeSpan', function () { + it('should return the correct value', function () { + const result = FieldType.TimeSpan; + expect(result).to.equal('TimeSpan'); + }); + }); + + describe('List', function () { + it('should return the correct value', function () { + const result = FieldType.List; + expect(result).to.equal('List'); + }); + }); + + describe('Reference', function () { + it('should return the correct value', function () { + const result = FieldType.Reference; + expect(result).to.equal('Reference'); + }); + }); + + describe('SurveyReference', function () { + it('should return the correct value', function () { + const result = FieldType.SurveyReference; + expect(result).to.equal('SurveyReference'); + }); + }); + + describe('SurveyGroupScoring', function () { + it('should return the correct value', function () { + const result = FieldType.SurveyGroupScoring; + expect(result).to.equal('SurveyGroupScoring'); + }); + }); + + describe('SurveyCampaign', function () { + it('should return the correct value', function () { + const result = FieldType.SurveyCampaign; + expect(result).to.equal('SurveyCampaign'); + }); + }); + + describe('SurveyUnifiedAnswer', function () { + it('should return the correct value', function () { + const result = FieldType.SurveyUnifiedAnswer; + expect(result).to.equal('SurveyUnifiedAnswer'); + }); + }); + + describe('Attachment', function () { + it('should return the correct value', function () { + const result = FieldType.Attachment; + expect(result).to.equal('Attachment'); + }); + }); +}); \ No newline at end of file diff --git a/tests/FileStorageSite.spec.ts b/tests/FileStorageSite.spec.ts new file mode 100644 index 0000000..f6778ff --- /dev/null +++ b/tests/FileStorageSite.spec.ts @@ -0,0 +1,25 @@ +import { FileStorageSite } from '../src/enums/FileStorageSite'; +import { expect } from 'chai'; + +describe('FileStorageSite', function () { + describe('GoogleDrive', function () { + it('should return the correct value', function () { + const result = FileStorageSite.GoogleDrive; + expect(result).to.equal('GoogleDrive'); + }); + }); + + describe('OneDrive', function () { + it('should return the correct value', function () { + const result = FileStorageSite.OneDrive; + expect(result).to.equal('OneDrive'); + }); + }); + + describe('Internal', function () { + it('should return the correct value', function () { + const result = FileStorageSite.Internal; + expect(result).to.equal('Internal'); + }); + }); +}); \ No newline at end of file diff --git a/tests/FormulaOutputType.spec.ts b/tests/FormulaOutputType.spec.ts new file mode 100644 index 0000000..394a820 --- /dev/null +++ b/tests/FormulaOutputType.spec.ts @@ -0,0 +1,32 @@ +import { FormulaOutputType } from '../src/enums/FormulaOutputType'; +import { expect } from 'chai'; + +describe('FormulaOutputType', function () { + describe('Text', function () { + it('should return the correct value', function () { + const result = FormulaOutputType.Text; + expect(result).to.equal('Text'); + }); + }); + + describe('Numeric', function () { + it('should return the correct value', function () { + const result = FormulaOutputType.Numeric; + expect(result).to.equal('Numeric'); + }); + }); + + describe('DateAndTime', function () { + it('should return the correct value', function () { + const result = FormulaOutputType.DateAndTime; + expect(result).to.equal('DateAndTime'); + }); + }); + + describe('ListValue', function () { + it('should return the correct value', function () { + const result = FormulaOutputType.ListValue; + expect(result).to.equal('ListValue'); + }); + }); +}); \ No newline at end of file diff --git a/tests/Multiplicity.spec.ts b/tests/Multiplicity.spec.ts new file mode 100644 index 0000000..0f6b5f0 --- /dev/null +++ b/tests/Multiplicity.spec.ts @@ -0,0 +1,18 @@ +import { Multiplicity } from '../src/enums/Multiplicity'; +import { expect } from 'chai'; + +describe('Multiplicity', function () { + describe('SingleSelect', function () { + it('should return the correct value', function () { + const result = Multiplicity.SingleSelect; + expect(result).to.equal('SingleSelect'); + }); + }); + + describe('MultiSelect', function () { + it('should return the correct value', function () { + const result = Multiplicity.MultiSelect; + expect(result).to.equal('MultiSelect'); + }); + }); +}); \ No newline at end of file diff --git a/tests/ReportDataType.spec.ts b/tests/ReportDataType.spec.ts new file mode 100644 index 0000000..3c80dcc --- /dev/null +++ b/tests/ReportDataType.spec.ts @@ -0,0 +1,18 @@ +import { ReportDataType } from '../src/enums/ReportDataType'; +import { expect } from 'chai'; + +describe('ReportDataType', function () { + describe('ReportData', function () { + it('should return the correct value', function () { + const result = ReportDataType.ReportData; + expect(result).to.equal('ReportData'); + }); + }); + + describe('ChartData', function () { + it('should return the correct value', function () { + const result = ReportDataType.ChartData; + expect(result).to.equal('ChartData'); + }); + }); +}); \ No newline at end of file diff --git a/tests/ResultValueType.ts b/tests/ResultValueType.ts new file mode 100644 index 0000000..0b94727 --- /dev/null +++ b/tests/ResultValueType.ts @@ -0,0 +1,88 @@ +import { ResultValueType } from '../src/enums/ResultValueType'; +import { expect } from 'chai'; + +describe('ResultValueType', function () { + describe('String', function () { + it('should return the correct value', function () { + const result = ResultValueType.String; + expect(result).to.equal('String'); + }); + }); + + describe('Integer', function () { + it('should return the correct value', function () { + const result = ResultValueType.Integer; + expect(result).to.equal('Integer'); + }); + }); + + describe('Decimal', function () { + it('should return the correct value', function () { + const result = ResultValueType.Decimal; + expect(result).to.equal('Decimal'); + }); + }); + + describe('Date', function () { + it('should return the correct value', function () { + const result = ResultValueType.Date; + expect(result).to.equal('Date'); + }); + }); + + describe('TimeSpan', function () { + it('should return the correct value', function () { + const result = ResultValueType.TimeSpan; + expect(result).to.equal('TimeSpan'); + }); + }); + + describe('Guid', function () { + it('should return the correct value', function () { + const result = ResultValueType.Guid; + expect(result).to.equal('Guid'); + }); + }); + + describe('StringList', function () { + it('should return the correct value', function () { + const result = ResultValueType.StringList; + expect(result).to.equal('StringList'); + }); + }); + + describe('IntegerList', function () { + it('should return the correct value', function () { + const result = ResultValueType.IntegerList; + expect(result).to.equal('IntegerList'); + }); + }); + + describe('GuidList', function () { + it('should return the correct value', function () { + const result = ResultValueType.GuidList; + expect(result).to.equal('GuidList'); + }); + }); + + describe('AttachmentList', function () { + it('should return the correct value', function () { + const result = ResultValueType.AttachmentList; + expect(result).to.equal('AttachmentList'); + }); + }); + + describe('ScoringGroupList', function () { + it('should return the correct value', function () { + const result = ResultValueType.ScoringGroupList; + expect(result).to.equal('ScoringGroupList'); + }); + }); + + describe('FileList', function () { + it('should return the correct value', function () { + const result = ResultValueType.FileList; + expect(result).to.equal('FileList'); + }); + }); +}); \ No newline at end of file diff --git a/tests/TimeSpanIncrement.spec.ts b/tests/TimeSpanIncrement.spec.ts new file mode 100644 index 0000000..a343577 --- /dev/null +++ b/tests/TimeSpanIncrement.spec.ts @@ -0,0 +1,53 @@ +import { TimeSpanIncrement } from '../src/enums/TimeSpanIncrement'; +import { expect } from 'chai'; + +describe('TimeSpanIncrement', function () { + describe('Seconds', function () { + it('should return the correct value', function () { + const result = TimeSpanIncrement.Seconds; + expect(result).to.equal('Seconds'); + }); + }); + + describe('Minutes', function () { + it('should return the correct value', function () { + const result = TimeSpanIncrement.Minutes; + expect(result).to.equal('Minutes'); + }); + }); + + describe('Hours', function () { + it('should return the correct value', function () { + const result = TimeSpanIncrement.Hours; + expect(result).to.equal('Hours'); + }); + }); + + describe('Days', function () { + it('should return the correct value', function () { + const result = TimeSpanIncrement.Days; + expect(result).to.equal('Days'); + }); + }); + + describe('Weeks', function () { + it('should return the correct value', function () { + const result = TimeSpanIncrement.Weeks; + expect(result).to.equal('Weeks'); + }); + }); + + describe('Months', function () { + it('should return the correct value', function () { + const result = TimeSpanIncrement.Months; + expect(result).to.equal('Months'); + }); + }); + + describe('Years', function () { + it('should return the correct value', function () { + const result = TimeSpanIncrement.Years; + expect(result).to.equal('Years'); + }); + }); +}); \ No newline at end of file diff --git a/tests/TimeSpanRecurrenceType.spec.ts b/tests/TimeSpanRecurrenceType.spec.ts new file mode 100644 index 0000000..071aa33 --- /dev/null +++ b/tests/TimeSpanRecurrenceType.spec.ts @@ -0,0 +1,25 @@ +import { TimeSpanRecurrenceType } from '../src/enums/TimeSpanRecurrenceType'; +import { expect } from 'chai'; + +describe('TimeSpanRecurrenceType', function () { + describe('None', function () { + it('should return the correct value', function () { + const result = TimeSpanRecurrenceType.None; + expect(result).to.equal('None'); + }); + }); + + describe('EndByDate', function () { + it('should return the correct value', function () { + const result = TimeSpanRecurrenceType.EndByDate; + expect(result).to.equal('EndByDate'); + }); + }); + + describe('EndAfterOccurrences', function () { + it('should return the correct value', function () { + const result = TimeSpanRecurrenceType.EndAfterOccurrences; + expect(result).to.equal('EndAfterOccurrences'); + }); + }); +}); \ No newline at end of file