From 08abd5d2773ae78715f7d7d0210d7db6a295dcba Mon Sep 17 00:00:00 2001 From: David Lechner Date: Tue, 22 Mar 2022 19:16:23 -0500 Subject: [PATCH] explorer/fileNameFormGroup: add test --- .../FileNameFormGroup.test.tsx | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/explorer/fileNameFormGroup/FileNameFormGroup.test.tsx diff --git a/src/explorer/fileNameFormGroup/FileNameFormGroup.test.tsx b/src/explorer/fileNameFormGroup/FileNameFormGroup.test.tsx new file mode 100644 index 00000000..ac1b8218 --- /dev/null +++ b/src/explorer/fileNameFormGroup/FileNameFormGroup.test.tsx @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: MIT +// Copyright (c) 2022 The Pybricks Authors + +import { cleanup } from '@testing-library/react'; +import React from 'react'; +import { testRender } from '../../../test'; +import { FileNameValidationResult } from '../../pybricksMicropython/lib'; +import FileNameFormGroup from './FileNameFormGroup'; + +afterEach(() => { + cleanup(); +}); + +describe('should handle all possible validation results', () => { + it.each( + Object.entries(FileNameValidationResult).filter( + ([, v]) => typeof v === 'number', + ) as [string, FileNameValidationResult][], + )('FileNameValidationResult.%s', (_name, result) => { + testRender( + undefined} + />, + ); + }); +});