Skip to content

Commit 2903e2d

Browse files
author
Hamas Shafiq
authored
Chore: Refactor UiFindInput.test.js to TypeScript (grafana#59063)
1 parent 7ff41cd commit 2903e2d

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Copyright (c) 2019 Uber Technologies, Inc.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
import { render, screen } from '@testing-library/react';
16+
import React from 'react';
17+
18+
import UiFindInput from './UiFindInput';
19+
20+
describe('UiFindInput', () => {
21+
describe('rendering', () => {
22+
it('renders as expected with no value', () => {
23+
render(<UiFindInput />);
24+
const uiFindInput = screen.queryByPlaceholderText('Find...');
25+
expect(uiFindInput).toBeInTheDocument();
26+
expect(uiFindInput?.getAttribute('value')).toEqual('');
27+
});
28+
29+
it('renders as expected with value', () => {
30+
render(<UiFindInput value="value" />);
31+
const uiFindInput = screen.queryByPlaceholderText('Find...');
32+
expect(uiFindInput).toBeInTheDocument();
33+
expect(uiFindInput?.getAttribute('value')).toEqual('value');
34+
});
35+
});
36+
});

0 commit comments

Comments
 (0)