diff --git a/__tests__/types/__typescript__/componentSendTextBox.tsx b/__tests__/types/__typescript__/componentSendTextBox.tsx new file mode 100644 index 0000000000..5cb542f45a --- /dev/null +++ b/__tests__/types/__typescript__/componentSendTextBox.tsx @@ -0,0 +1,7 @@ +import { Components } from '../../../packages/bundle/lib/index'; + +function main() { + const { SendTextBox } = Components; + + return ; +} diff --git a/__tests__/types/__typescript__/dirInComposer.tsx b/__tests__/types/__typescript__/dirInComposer.tsx new file mode 100644 index 0000000000..c689feb434 --- /dev/null +++ b/__tests__/types/__typescript__/dirInComposer.tsx @@ -0,0 +1,5 @@ +import Composer from '../../../packages/component/lib/Composer'; + +function main() { + return ; +} diff --git a/__tests__/types/__typescript__/directLineInComposer.tsx b/__tests__/types/__typescript__/directLineInComposer.tsx new file mode 100644 index 0000000000..db5e867feb --- /dev/null +++ b/__tests__/types/__typescript__/directLineInComposer.tsx @@ -0,0 +1,8 @@ +import Composer from '../../../packages/component/lib/Composer'; +import createDirectLine from '../../../packages/bundle/lib/createDirectLine'; + +function main() { + const directLine = createDirectLine({ token: 'faketoken'}); + + return ; +} diff --git a/__tests__/types/__typescript__/directLineObject.tsx b/__tests__/types/__typescript__/directLineObject.tsx new file mode 100644 index 0000000000..601a1e170b --- /dev/null +++ b/__tests__/types/__typescript__/directLineObject.tsx @@ -0,0 +1,8 @@ +import ReactWebChat from '../../../packages/bundle/lib/index'; +import createDirectLine from '../../../packages/bundle/lib/createDirectLine'; + +function main() { + const directLine = createDirectLine({ token: 'faketoken'}); + + return ; +} diff --git a/__tests__/types/__typescript__/storeInComposer.tsx b/__tests__/types/__typescript__/storeInComposer.tsx new file mode 100644 index 0000000000..4e045ddf3b --- /dev/null +++ b/__tests__/types/__typescript__/storeInComposer.tsx @@ -0,0 +1,8 @@ +import Composer from '../../../packages/component/lib/Composer'; +import createStore from '../../../packages/core/lib/createStore'; + +function main() { + const store = createStore({}); + + return ; +} diff --git a/__tests__/types/__typescript__/storeObject.tsx b/__tests__/types/__typescript__/storeObject.tsx new file mode 100644 index 0000000000..b490308cd7 --- /dev/null +++ b/__tests__/types/__typescript__/storeObject.tsx @@ -0,0 +1,8 @@ +import ReactWebChat from '../../../packages/bundle/lib/index'; +import createStore from '../../../packages/core/lib/createStore'; + +function main() { + const store = createStore({}); + + return ; +} diff --git a/__tests__/types/__typescript__/styleOptionsAccent.tsx b/__tests__/types/__typescript__/styleOptionsAccent.tsx index 5c88b8480f..86b3f71d1e 100644 --- a/__tests__/types/__typescript__/styleOptionsAccent.tsx +++ b/__tests__/types/__typescript__/styleOptionsAccent.tsx @@ -5,6 +5,6 @@ function main() { createStyleSet(styleOptions); - // Verify: Setting "accent" must should pass. + // Verify: Setting "accent" must pass. return ; } diff --git a/__tests__/types/typesCheck.js b/__tests__/types/typesCheck.js index da708ee51b..0e6d4cc08f 100644 --- a/__tests__/types/typesCheck.js +++ b/__tests__/types/typesCheck.js @@ -26,6 +26,29 @@ function compile(...filenames) { return errors; }; +it('should pass with non-exported component type SendTextBox', () => { + const componentErrors = compile(path.join(__dirname, './__typescript__/componentSendTextBox.tsx')); + + expect(componentErrors).toHaveProperty('length', 0); +}); + +it('should pass with non-exported type directLine', () => { + const directLineErrors = compile(path.join(__dirname, './__typescript__/directLineObject.tsx')); + + expect(directLineErrors).toHaveProperty('length', 0); +}); + +it('should pass with non-exported type directLine in Composer', () => { + const directLineErrors = compile(path.join(__dirname, './__typescript__/directLineInComposer.tsx')); + + expect(directLineErrors).toHaveProperty('length', 0); +}); + +it('should pass dir as string in Composer ', () => { + const dirStringErrors = compile(path.join(__dirname, './__typescript__/dirInComposer.tsx')); + + expect(dirStringErrors).toHaveProperty('length', 0); +}); it('should pass dir as string', () => { const dirStringErrors = compile(path.join(__dirname, './__typescript__/dirString.tsx')); @@ -40,6 +63,18 @@ it('should fail on dir as number', () => { expect(dirNumErrors[0]).toEqual(expect.stringContaining(`Type 'number' is not assignable to type '"ltr" | "rtl" | "auto"'`)); }); +it('should pass with non-exported type store', () => { + const storeObjectErrors = compile(path.join(__dirname, './__typescript__/storeObject.tsx')); + + expect(storeObjectErrors).toHaveProperty('length', 0); +}); + +it('should pass with non-exported type store in Composer ', () => { + const storeObjectErrors = compile(path.join(__dirname, './__typescript__/storeInComposer.tsx')); + + expect(storeObjectErrors).toHaveProperty('length', 0); +}); + it('should fail on accent', () => { const accentErrors = compile(path.join(__dirname, './__typescript__/styleOptionsAccent.tsx'));