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