Skip to content

Commit

Permalink
Add simple type test for design components (#49538)
Browse files Browse the repository at this point in the history
  • Loading branch information
ravicious authored Nov 29, 2024
1 parent 4c7b64f commit 76bfe76
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions web/packages/design/src/styled-components.type-test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* Teleport
* Copyright (C) 2024 Gravitational, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import Box from './Box';

/**
* TypeTest is supposed to catch regressions in the types for our design components.
*
* The file name specifically uses the "type-test.tsx" suffix so that this file isn't ran by Jest.
*/
export const TypeTest = () => (
<Box>
<Box
// @ts-expect-error Prop that doesn't exist on Box.
nonexistentprop
/>
<Box
// @ts-expect-error Valid prop but invalid value type.
alignSelf={2}
/>
</Box>
);

0 comments on commit 76bfe76

Please sign in to comment.