-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Snapshot Testing for Popup, View, and Flyout (#10660)
* Add Snapshots * Change files * Adjust Snaps * Fix Snapshot * Fix Lint * Remove Stale Snap
- Loading branch information
1 parent
bb28969
commit 59c2ab9
Showing
11 changed files
with
2,113 additions
and
12 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/react-native-windows-9b43bc5d-6bc8-402e-b303-e46db511fce8.json
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,7 @@ | ||
{ | ||
"type": "prerelease", | ||
"comment": "Add Snapshots", | ||
"packageName": "react-native-windows", | ||
"email": "34109996+chiaramooney@users.noreply.github.com", | ||
"dependentChangeType": "patch" | ||
} |
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
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
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
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,13 @@ | ||
import {dumpVisualTree} from '@react-native-windows/automation-commands'; | ||
import {goToComponentExample} from './RNTesterNavigation'; | ||
|
||
beforeAll(async () => { | ||
await goToComponentExample('Flyout'); | ||
}); | ||
|
||
describe('FlyoutTests', () => { | ||
test('Flyout', async () => { | ||
const dump = await dumpVisualTree('flyout'); | ||
expect(dump).toMatchSnapshot(); | ||
}); | ||
}); |
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,17 @@ | ||
import {dumpVisualTree} from '@react-native-windows/automation-commands'; | ||
import {goToComponentExample} from './RNTesterNavigation'; | ||
|
||
beforeAll(async () => { | ||
await goToComponentExample('Popup'); | ||
}); | ||
|
||
describe('PopupTests', () => { | ||
test('Popups can be anchored', async () => { | ||
const dump = await dumpVisualTree('anchor-popup'); | ||
expect(dump).toMatchSnapshot(); | ||
}); | ||
test('Popups can have different placement', async () => { | ||
const dump = await dumpVisualTree('popup-placement'); | ||
expect(dump).toMatchSnapshot(); | ||
}); | ||
}); |
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,52 @@ | ||
/** | ||
* Copyright (c) Microsoft Corporation. | ||
* Licensed under the MIT License. | ||
* | ||
* @format | ||
*/ | ||
|
||
import {dumpVisualTree} from '@react-native-windows/automation-commands'; | ||
import {goToComponentExample} from './RNTesterNavigation'; | ||
|
||
beforeAll(async () => { | ||
await goToComponentExample('View'); | ||
}); | ||
|
||
describe('ViewTests', () => { | ||
test('Views can have background colors', async () => { | ||
const dump = await dumpVisualTree('background-color'); | ||
expect(dump).toMatchSnapshot(); | ||
}); | ||
test('Views can have borders', async () => { | ||
const dump = await dumpVisualTree('border'); | ||
expect(dump).toMatchSnapshot(); | ||
}); | ||
test('Views can have padding and margins', async () => { | ||
const dump = await dumpVisualTree('padding-margin'); | ||
expect(dump).toMatchSnapshot(); | ||
}); | ||
test('Views can have rounded borders', async () => { | ||
const dump = await dumpVisualTree('rounded-borders'); | ||
expect(dump).toMatchSnapshot(); | ||
}); | ||
test('Views can have overflow', async () => { | ||
const dump = await dumpVisualTree('overflow'); | ||
expect(dump).toMatchSnapshot(); | ||
}); | ||
test('Views can have ranging opacity', async () => { | ||
const dump = await dumpVisualTree('opacity'); | ||
expect(dump).toMatchSnapshot(); | ||
}); | ||
test('Views can have tool tips', async () => { | ||
const dump = await dumpVisualTree('tool-tip'); | ||
expect(dump).toMatchSnapshot(); | ||
}); | ||
test('Views can adjust backface visibility', async () => { | ||
const dump = await dumpVisualTree('backface-visibility'); | ||
expect(dump).toMatchSnapshot(); | ||
}); | ||
test('Views can adjust backface visibility 2', async () => { | ||
const dump = await dumpVisualTree('backface-visibility-2'); | ||
expect(dump).toMatchSnapshot(); | ||
}); | ||
}); |
Oops, something went wrong.