-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Add displayName to ActivityIndicator (#22417)
Summary: Similar to #21950, this adds displayName to `ActivityIndicator`, so it displays the correct component name in snapshots instead of `Component`. Fixes #21937 (a little bit more than it was already fixed). Pull Request resolved: #22417 Differential Revision: D13205376 Pulled By: TheSavior fbshipit-source-id: 21e71d4980d159a1f33d32d83346b48257ec21d4
- Loading branch information
1 parent
3fbefa8
commit 0b32a65
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
Libraries/Components/ActivityIndicator/__tests__/ActivityIndicator-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
* @emails oncall+react_native | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const React = require('React'); | ||
const ReactTestRenderer = require('react-test-renderer'); | ||
const ActivityIndicator = require('ActivityIndicator'); | ||
|
||
describe('ActivityIndicator', () => { | ||
it('renders correctly', () => { | ||
const instance = ReactTestRenderer.create( | ||
<ActivityIndicator size="large" color="#0000ff" />, | ||
); | ||
|
||
expect(instance.toJSON()).toMatchSnapshot(); | ||
}); | ||
}); |
10 changes: 10 additions & 0 deletions
10
...aries/Components/ActivityIndicator/__tests__/__snapshots__/ActivityIndicator-test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`ActivityIndicator renders correctly 1`] = ` | ||
<ActivityIndicator | ||
animating={true} | ||
color="#0000ff" | ||
hidesWhenStopped={true} | ||
size="large" | ||
/> | ||
`; |