-
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 #2010 from tf/improve-outline
Improve transition display in outline
- Loading branch information
Showing
7 changed files
with
128 additions
and
33 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
49 changes: 49 additions & 0 deletions
49
entry_types/scrolled/package/spec/editor/models/Section-spec.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,49 @@ | ||
import {ScrolledEntry} from 'editor/models/ScrolledEntry'; | ||
import {factories} from 'pageflow/testHelpers'; | ||
import {normalizeSeed} from 'support'; | ||
|
||
describe('Section', () => { | ||
describe('getTransition', () => { | ||
it('returns transition from configuration', () => { | ||
const entry = factories.entry(ScrolledEntry, {}, { | ||
entryTypeSeed: normalizeSeed({ | ||
sections: [ | ||
{id: 10, position: 0}, | ||
{id: 11, position: 1, configuration: {transition: 'reveal'}} | ||
] | ||
}) | ||
}); | ||
const section = entry.sections.get(11); | ||
|
||
expect(section.getTransition()).toEqual('reveal'); | ||
}); | ||
|
||
it('turns fade into scroll if fade transition is not available', () => { | ||
const entry = factories.entry(ScrolledEntry, {}, { | ||
entryTypeSeed: normalizeSeed({ | ||
sections: [ | ||
{id: 10, position: 0, configuration: {fullHeight: false}}, | ||
{id: 11, position: 1, configuration: {transition: 'fade', fullHeight: true}} | ||
] | ||
}) | ||
}); | ||
const section = entry.sections.get(11); | ||
|
||
expect(section.getTransition()).toEqual('scroll'); | ||
}); | ||
|
||
it('keeps fade if fade transition is available', () => { | ||
const entry = factories.entry(ScrolledEntry, {}, { | ||
entryTypeSeed: normalizeSeed({ | ||
sections: [ | ||
{id: 10, position: 0, configuration: {fullHeight: true}}, | ||
{id: 11, position: 1, configuration: {transition: 'fade', fullHeight: true}} | ||
] | ||
}) | ||
}); | ||
const section = entry.sections.get(11); | ||
|
||
expect(section.getTransition()).toEqual('fade'); | ||
}); | ||
}); | ||
}); |
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