123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353 |
- describe('title.subtextStyle', function() {
- var uiHelper = window.uiHelper;
- var suites = [{
- name: 'subtextStyle.color',
- cases: [{
- name: 'should display expected color name',
- option: {
- series: [],
- title: {
- subtext: 'a red subtitle',
- subtextStyle: {
- color: 'red'
- }
- }
- }
- }, {
- name: 'should display expected color 6-digit hex',
- option: {
- series: [],
- title: {
- subtext: 'an orange subtitle',
- subtextStyle: {
- color: '#ff6600'
- }
- }
- }
- }, {
- name: 'should display expected color 3-digit hex',
- option: {
- series: [],
- title: {
- subtext: 'an orange subtitle',
- subtextStyle: {
- color: '#f60'
- }
- }
- }
- }, {
- name: 'should display expected color rgb',
- option: {
- series: [],
- title: {
- subtext: 'an orange subtitle',
- subtextStyle: {
- color: 'rgb(255, 127, 0)'
- }
- }
- }
- }, {
- name: 'should display expected color rgba',
- option: {
- series: [],
- title: {
- subtext: 'an orange subtitle with alpha',
- subtextStyle: {
- color: 'rgba(255, 127, 0, 0.5)'
- }
- }
- }
- }]
- }, {
- name: 'subtextStyle.fontStyle',
- cases: [{
- name: 'should display normal font style',
- option: {
- series: [],
- title: {
- subtext: 'normal font',
- subtextStyle: {
- fontStyle: 'normal'
- }
- }
- }
- }, {
- name: 'should display italic font style',
- option: {
- series: [],
- title: {
- subtext: 'italic font',
- subtextStyle: {
- fontStyle: 'italic'
- }
- }
- }
- }, {
- name: 'should display oblique font style',
- option: {
- series: [],
- title: {
- subtext: 'oblique font',
- subtextStyle: {
- fontStyle: 'oblique'
- }
- }
- }
- }, {
- name: 'should display italic not as normal',
- test: 'notEqualOption',
- option1: {
- series: [],
- title: {
- subtext: 'italic vs. normal',
- subtextStyle: {
- fontStyle: 'italic'
- }
- }
- },
- option2: {
- series: [],
- title: {
- subtext: 'italic vs. normal',
- subtextStyle: {
- fontStyle: 'normal'
- }
- }
- }
- }, {
- name: 'should display oblique not as normal',
- test: 'notEqualOption',
- option1: {
- series: [],
- title: {
- subtext: 'oblique vs. normal',
- subtextStyle: {
- fontStyle: 'oblique'
- }
- }
- },
- option2: {
- series: [],
- title: {
- subtext: 'oblique vs. normal',
- subtextStyle: {
- fontStyle: 'normal'
- }
- }
- }
- }]
- }, {
- name: 'subtextStyle.fontWeight',
- cases: [{
- name: 'should display default normal font weight',
- test: 'equalOption',
- option1: {
- series: [],
- title: {
- subtext: 'normal font'
- }
- },
- option2: {
- series: [],
- title: {
- subtext: 'normal font',
- subtextStyle: {
- fontWeight: 'normal'
- }
- }
- }
- }, {
- name: 'should display bold font weight',
- test: 'notEqualOption',
- option1: {
- series: [],
- title: {
- subtext: 'bold font vs. normal font',
- subtextStyle: {
- fontStyle: 'bold'
- }
- }
- },
- option2: {
- series: [],
- title: {
- subtext: 'bold font vs. normal font',
- subtextStyle: {
- fontStyle: 'normal'
- }
- }
- }
- }, {
- name: 'should display bolder font weight',
- test: 'notEqualOption',
- option1: {
- series: [],
- title: {
- subtext: 'bolder font vs. normal font',
- subtextStyle: {
- fontStyle: 'bolder'
- }
- }
- },
- option2: {
- series: [],
- title: {
- subtext: 'bolder font vs. normal font',
- subtextStyle: {
- fontStyle: 'normal'
- }
- }
- }
- }, {
- name: 'should display light font weight',
- test: 'notEqualOption',
- option1: {
- series: [],
- title: {
- subtext: 'light font vs. normal font',
- subtextStyle: {
- fontStyle: 'light'
- }
- }
- },
- option2: {
- series: [],
- title: {
- subtext: 'light font vs. normal font',
- subtextStyle: {
- fontStyle: 'normal'
- }
- }
- }
- }, {
- name: 'should display numbering font weight',
- test: 'notEqualOption',
- option1: {
- series: [],
- title: {
- subtext: '100 font vs. normal font',
- subtextStyle: {
- fontStyle: '100'
- }
- }
- },
- option2: {
- series: [],
- title: {
- subtext: '100 font vs. normal font',
- subtextStyle: {
- fontStyle: 'normal'
- }
- }
- }
- }]
- }, {
- name: 'subtextStyle.fontFamily',
- cases: [{
- name: 'should display default fontFamily as sans-serif',
- test: 'equalOption',
- option1: {
- series: [],
- title: {
- subtext: 'sans-serif'
- }
- },
- option2: {
- series: [],
- title: {
- subtext: 'sans-serif',
- fontFamily: 'sans-serif'
- }
- }
- }, {
- name: 'should display default fontFamily as Arial',
- test: 'notEqualOption',
- option1: {
- series: [],
- title: {
- subtext: 'Arial vs. sans-serif',
- subtextStyle: {
- fontFamily: 'Arial'
- }
- }
- },
- option2: {
- series: [],
- title: {
- subtext: 'Arial vs. sans-serif',
- subtextStyle: {
- fontFamily: 'sans-serif'
- }
- }
- }
- }]
- }, {
- name: 'textStyle.fontSize',
- cases: [{
- name: 'should display default fontSize at 18',
- test: 'equalOption',
- option1: {
- series: [],
- title: {
- subtext: 'default font size, should be 18'
- }
- },
- option2: {
- series: [],
- title: {
- subtext: 'default font size, should be 18',
- subtextStyle: {
- fontSize: 18
- }
- }
- }
- }, {
- name: 'should display larger fontSize',
- test: 'notEqualOption',
- option1: {
- series: [],
- title: {
- subtext: 'larger font size, 30',
- subtextStyle: {
- fontSize: 30
- }
- }
- },
- option2: {
- series: [],
- title: {
- subtext: 'larger font size, 30',
- subtextStyle: {
- fontSize: 18
- }
- }
- }
- }, {
- name: 'should display smaller fontSize',
- test: 'notEqualOption',
- option1: {
- series: [],
- title: {
- subtext: 'smaller font size, 12',
- subtextStyle: {
- fontSize: 12
- }
- }
- },
- option2: {
- series: [],
- title: {
- subtext: 'smaller font size, 12',
- subtextStyle: {
- fontSize: 18
- }
- }
- }
- }]
- }];
- uiHelper.testOptionSpec('title.subtextStyle', suites);
- });
|