diff --git a/tests/col-bounds-required.test.ts b/tests/training-sheets/col-bounds-required.test.ts similarity index 93% rename from tests/col-bounds-required.test.ts rename to tests/training-sheets/col-bounds-required.test.ts index d0c08a70..31e8905a 100644 --- a/tests/col-bounds-required.test.ts +++ b/tests/training-sheets/col-bounds-required.test.ts @@ -1,5 +1,5 @@ import * as O from 'fp-ts/Option'; -import {columnBoundsRequired} from '../src/training-sheets/google'; +import {columnBoundsRequired} from '../../src/training-sheets/google'; describe('columnBoundsRequired', () => { [ diff --git a/tests/get-chunk-indexes.test.ts b/tests/training-sheets/get-chunk-indexes.test.ts similarity index 91% rename from tests/get-chunk-indexes.test.ts rename to tests/training-sheets/get-chunk-indexes.test.ts index 1af51139..6ca7101e 100644 --- a/tests/get-chunk-indexes.test.ts +++ b/tests/training-sheets/get-chunk-indexes.test.ts @@ -1,4 +1,4 @@ -import {getChunkIndexes} from '../src/util'; +import {getChunkIndexes} from '../../src/util'; describe('Get chunk indexes', () => { [ diff --git a/tests/training-sheets/google-timezone.test.ts b/tests/training-sheets/google-timezone.test.ts new file mode 100644 index 00000000..6e0aceb3 --- /dev/null +++ b/tests/training-sheets/google-timezone.test.ts @@ -0,0 +1,25 @@ +import {GoogleTimezone} from '../../src/init-dependencies/google/pull_sheet_data'; +import {getRightOrFail} from '../helpers'; + +describe('Google timezone parse', () => { + it('Empty default', () => { + expect(getRightOrFail(GoogleTimezone.decode(''))).toStrictEqual( + 'Europe/London' + ); + }); + it('Malformed default', () => { + expect(getRightOrFail(GoogleTimezone.decode(null))).toStrictEqual( + 'Europe/London' + ); + }); + it('Known timezone', () => { + expect(getRightOrFail(GoogleTimezone.decode('Africa/Cairo'))).toStrictEqual( + 'Africa/Cairo' + ); + }); + it('Unknown timezone', () => { + expect( + getRightOrFail(GoogleTimezone.decode('Makespace/Cambridge')) + ).toStrictEqual('Europe/London'); + }); +});