-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2119 from tf/filter-scrolled-editor-widgets
Do not sync non-react widgets to scrolled state in editor
- Loading branch information
Showing
9 changed files
with
99 additions
and
6 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
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,35 @@ | ||
import {WidgetsCollection} from 'editor/collections/WidgetsCollection'; | ||
import {factories} from '$support'; | ||
|
||
describe('WidgetsCollection', () => { | ||
it('supports gettting subset collection for insert point', () => { | ||
const widgetTypes = factories.widgetTypes([ | ||
{role: 'navigation', name: 'some_navigation_bar', insertPoint: 'react'}, | ||
{role: 'consent', name: 'some_consent_provider', insertPoint: 'bottom_of_entry'} | ||
]); | ||
const widgets = new WidgetsCollection([ | ||
{type_name: 'some_navigation_bar'}, | ||
{type_name: 'some_consent_provider'}, | ||
], {widgetTypes}); | ||
|
||
expect( | ||
widgets.withInsertPoint('react').pluck('type_name') | ||
).toEqual(['some_navigation_bar']); | ||
}); | ||
|
||
it('keeps insert point subset collection up to date when type name changes', () => { | ||
const widgetTypes = factories.widgetTypes([ | ||
{role: 'consent', name: 'consent_bar', insertPoint: 'react'}, | ||
{role: 'consent', name: 'some_consent_provider', insertPoint: 'bottom_of_entry'} | ||
]); | ||
const widgets = new WidgetsCollection([ | ||
{type_name: 'some_consent_provider'}, | ||
], {widgetTypes}); | ||
widgets.subject = factories.entry(); | ||
|
||
const subsetCollection = widgets.withInsertPoint('react'); | ||
widgets.first().set('type_name', 'consent_bar'); | ||
|
||
expect(subsetCollection.pluck('type_name')).toEqual(['consent_bar']); | ||
}); | ||
}); |
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