-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat((pin 262) crr dd): [sc-22942] FSI Note order for 'View all FSI n…
…otes and Actions ' (#349) * feat: [sc-22942] changed positioning of timeline entry launches menu, added badge topSpacing config * test: [sc-22942] added construction tests for TimelineEntry * refactor: [sc-22942] minor refactor and added badge construction tests
- Loading branch information
Showing
4 changed files
with
120 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* eslint-env mocha */ | ||
|
||
'use strict' | ||
const Chip = require('./../lib/builders/Chip') | ||
const chai = require('chai') | ||
const expect = chai.expect | ||
|
||
describe('badge construction tests', function () { | ||
it('just text', function () { | ||
const badge = Chip({ | ||
style: 'badge', | ||
icon: null, | ||
text: 'TEXT', | ||
topSpacing: null | ||
}, null) | ||
expect(badge).to.eql('<q-badge multi-line class="q-mr-sm q-mb-none q-ml-none q-mt-md">TEXT</q-badge>') | ||
}) | ||
|
||
it('icon and text', function () { | ||
const badge = Chip({ | ||
style: 'badge', | ||
icon: 'repeat', | ||
text: 'TEXT', | ||
topSpacing: null | ||
}, null) | ||
expect(badge).to.eql('<q-badge multi-line class="q-mr-sm q-mb-none q-ml-none q-mt-md">TEXT<q-icon name="repeat"></q-icon></q-badge>') | ||
}) | ||
|
||
it('icon and text with undefined top spacing', function () { | ||
const badge = Chip({ | ||
style: 'badge', | ||
icon: 'repeat', | ||
text: 'TEXT', | ||
topSpacing: null | ||
}, null) | ||
expect(badge).to.eql('<q-badge multi-line class="q-mr-sm q-mb-none q-ml-none q-mt-md">TEXT<q-icon name="repeat"></q-icon></q-badge>') | ||
}) | ||
|
||
it('icon and text with medium (default) top spacing', function () { | ||
const badge = Chip({ | ||
style: 'badge', | ||
icon: 'repeat', | ||
text: 'TEXT', | ||
topSpacing: 'medium' | ||
}, null) | ||
expect(badge).to.eql('<q-badge multi-line class="q-mr-sm q-mb-none q-ml-none q-mt-md">TEXT<q-icon name="repeat"></q-icon></q-badge>') | ||
}) | ||
|
||
it('icon and text with small top spacing', function () { | ||
const badge = Chip({ | ||
style: 'badge', | ||
icon: 'repeat', | ||
text: 'TEXT', | ||
topSpacing: 'small' | ||
}, null) | ||
expect(badge).to.eql('<q-badge multi-line class="q-mr-sm q-mb-none q-ml-none q-mt-sm">TEXT<q-icon name="repeat"></q-icon></q-badge>') | ||
}) | ||
|
||
it('icon and text with no top spacing', function () { | ||
const badge = Chip({ | ||
style: 'badge', | ||
icon: 'repeat', | ||
text: 'TEXT', | ||
topSpacing: 'none' | ||
}, null) | ||
expect(badge).to.eql('<q-badge multi-line class="q-mr-sm q-mb-none q-ml-none q-mt-none">TEXT<q-icon name="repeat"></q-icon></q-badge>') | ||
}) | ||
}) |
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,32 @@ | ||
/* eslint-env mocha */ | ||
|
||
'use strict' | ||
const TimelineEntry = require('./../lib/builders/TimelineEntry') | ||
const chai = require('chai') | ||
const expect = chai.expect | ||
|
||
describe('timeline entry construction tests', function () { | ||
it('just a title', function () { | ||
const timelineEntry = TimelineEntry({ | ||
icon: null, | ||
color: null, | ||
title: 'TITLE', | ||
subtitle: null, | ||
showWhen: null, | ||
showLaunches: null | ||
}, null) | ||
expect(timelineEntry).to.eql('<q-timeline-entry><template v-slot:title><div class="row"><div class="col">TITLE</div></div></template><template v-slot:subtitle></template>') | ||
}) | ||
|
||
it('title and subtitle', function () { | ||
const timelineEntry = TimelineEntry({ | ||
icon: null, | ||
color: null, | ||
title: 'TITLE', | ||
subtitle: 'SUBTITLE', | ||
showWhen: null, | ||
showLaunches: null | ||
}, null) | ||
expect(timelineEntry).to.eql('<q-timeline-entry><template v-slot:title><div class="row"><div class="col">TITLE</div></div></template><template v-slot:subtitle>SUBTITLE</template>') | ||
}) | ||
}) |