Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Does not affect unimplemented collections 1`] = `
"import {Accordion, Item, ActionBarContainer, ActionBar, ListView, ListBox} from '@adobe/react-spectrum';
import {SearchAutocomplete} from '@react-spectrum/autocomplete';
import {StepList} from '@react-spectrum/steplist';

<div>
<SearchAutocomplete>
<Item key="one">One</Item>
<Item key="two">Two</Item>
<Item key="three">Three</Item>
</SearchAutocomplete>
<Accordion>
<Item title="One" key="one">One</Item>
<Item title="Two" key="two">Two</Item>
<Item title="Three" key="three">Three</Item>
</Accordion>
<ActionBarContainer height={300} maxWidth="size-6000">
<ListView>
<Item key="photoshop">Adobe Photoshop</Item>
<Item key="illustrator">Adobe Illustrator</Item>
<Item key="xd">Adobe XD</Item>
</ListView>
<ActionBar>
<Item key="one">One</Item>
<Item key="two">Two</Item>
<Item key="three">Three</Item>
</ActionBar>
</ActionBarContainer>
<StepList>
<Item key="one">One</Item>
<Item key="two">Two</Item>
<Item key="three">Three</Item>
</StepList>
<ListBox>
<Item key="one">One</Item>
<Item key="two">Two</Item>
<Item key="three">Three</Item>
</ListBox>
</div>"
`;

exports[`Static - Renames Item to Breadcrumb and adds import 1`] = `
"import {
Breadcrumb,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,43 @@ import {Breadcrumbs, Item, Menu, MenuTrigger, SubmenuTrigger, Button, Section, H
</div>
`);

test('Does not affect unimplemented collections', `
import {Accordion, Item, ActionBarContainer, ActionBar, ListView, ListBox} from '@adobe/react-spectrum';
import {SearchAutocomplete} from '@react-spectrum/autocomplete';
import {StepList} from '@react-spectrum/steplist';

<div>
<SearchAutocomplete>
<Item key="one">One</Item>
<Item key="two">Two</Item>
<Item key="three">Three</Item>
</SearchAutocomplete>
<Accordion>
<Item title="One" key="one">One</Item>
<Item title="Two" key="two">Two</Item>
<Item title="Three" key="three">Three</Item>
</Accordion>
<ActionBarContainer height={300} maxWidth="size-6000">
<ListView>
<Item key="photoshop">Adobe Photoshop</Item>
<Item key="illustrator">Adobe Illustrator</Item>
<Item key="xd">Adobe XD</Item>
</ListView>
<ActionBar>
<Item key="one">One</Item>
<Item key="two">Two</Item>
<Item key="three">Three</Item>
</ActionBar>
</ActionBarContainer>
<StepList>
<Item key="one">One</Item>
<Item key="two">Two</Item>
<Item key="three">Three</Item>
</StepList>
<ListBox>
<Item key="one">One</Item>
<Item key="two">Two</Item>
<Item key="three">Three</Item>
</ListBox>
</div>
`);
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ function updateComponentWithinCollection(
function commentIfParentCollectionNotDetected(
path: NodePath<t.JSXElement>
) {
const collectionItemParents = new Set(['Menu', 'ActionMenu', 'TagGroup', 'Breadcrumbs', 'Picker', 'ComboBox', 'ListBox', 'TabList', 'TabPanels', 'ActionGroup', 'ListBox', 'ListView', 'Collection']);
const collectionItemParents = new Set(['Menu', 'ActionMenu', 'TagGroup', 'Breadcrumbs', 'Picker', 'ComboBox', 'ListBox', 'TabList', 'TabPanels', 'ActionGroup', 'ListBox', 'ListView', 'Collection', 'SearchAutocomplete', 'Accordion', 'ActionBar', 'StepList']);
if (
t.isJSXElement(path.node)
) {
Expand Down