Debian Codegraph @

test/acceptance/firefox/rules.ts

raw symbols SCIP
1 import {Selector} from 'testcafe';
2
3 fixture `Firefox Rules Tests`
4 .page `http://localhost:8080/test/page/with-css.html`;
5
6 test('Use a better box model (opinionated).', async t => {
7 await t
8 .expect(Selector('html').getStyleProperty('box-sizing')).eql('border-box');
9 });
10
11 test('Use a more readable tab size (opinionated).', async t => {
12 await t
13 .expect(Selector('html').getStyleProperty('tab-size')).eql('4');
14 });
15
16 test('Correct the line height in all browsers.', async t => {
17 await t
18 .expect(Selector('html').getStyleProperty('font-size')).eql('16px')
19 .expect(Selector('html').getStyleProperty('line-height')).eql('18.4px');
20 });
21
22 test('Prevent adjustments of font size after orientation changes in iOS.', async t => {
23 await t
24 .expect(Selector('html').getStyleProperty('text-size-adjust')).eql(undefined);
25 });
26
27 test('Remove the margin in all browsers.', async t => {
28 await t
29 .expect(Selector('body').getStyleProperty('margin-top')).eql('0px')
30 .expect(Selector('body').getStyleProperty('margin-right')).eql('0px')
31 .expect(Selector('body').getStyleProperty('margin-bottom')).eql('0px')
32 .expect(Selector('body').getStyleProperty('margin-left')).eql('0px');
33 });
34
35 test('Improve consistency of default fonts in all browsers.', async t => {
36 await t
37 .expect(Selector('body').getStyleProperty('font-family')).eql(`system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"`);
38 });
39
40 test('<hr> should be the correct height.', async t => {
41 await t
42 .expect(Selector('hr[data-test--hr]').getStyleProperty('height')).eql('2px');
43 });
44
45 test('Add the correct text decoration in Safari.', async t => {
46 await t
47 .expect(Selector('abbr[data-test--abbr]').getStyleProperty('text-decoration')).eql('underline dotted rgb(0, 0, 0)');
48 });
49
50 test('Add the correct font weight in Chrome and Safari.', async t => {
51 await t
52 .expect(Selector('b[data-test--bold]').getStyleProperty('font-weight')).eql('900')
53 .expect(Selector('strong[data-test--bold]').getStyleProperty('font-weight')).eql('900');
54 });
55
56 test('Improve consistency of default fonts in all browsers.', async t => {
57 await t
58 .expect(Selector('[data-test--code]').getStyleProperty('font-family')).eql('ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace');
59 });
60
61 test('Correct the odd `em` font sizing in all browsers.', async t => {
62 await t
63 .expect(Selector('[data-test--code]').getStyleProperty('font-size')).eql('16px');
64 });
65
66 test('Add the correct font size in all browsers.', async t => {
67 await t
68 .expect(Selector('[data-test--small]').getStyleProperty('font-size')).eql('12.8px');
69 });
70
71 test('Prevent `sub` and `sup` elements from affecting the line height in all browsers.', async t => {
72 await t
73 .expect(Selector('[data-test--subsup]').getStyleProperty('font-size')).eql('12px')
74 .expect(Selector('[data-test--subsup]').getStyleProperty('line-height')).eql('0px')
75 .expect(Selector('[data-test--subsup]').getStyleProperty('position')).eql('relative')
76 .expect(Selector('[data-test--subsup]').getStyleProperty('vertical-align')).eql('baseline')
77 .expect(Selector('sub[data-test--subsup]').getStyleProperty('bottom')).eql('-3px')
78 .expect(Selector('sup[data-test--subsup]').getStyleProperty('top')).eql('-6px');
79 });
80
81 test('Change the font styles in all browsers.', async t => {
82 await t
83 .expect(Selector('[data-test--forms-1]').getStyleProperty('font-family')).eql('MYCUSTOMFONT')
84 .expect(Selector('[data-test--forms-1]').getStyleProperty('font-size')).eql('16px')
85 .expect(Selector('[data-test--forms-1]').getStyleProperty('line-height')).eql('18.4px');
86 });
87
88 test('Remove the margin in Firefox and Safari.', async t => {
89 await t
90 .expect(Selector('[data-test--forms-1]').getStyleProperty('margin-top')).eql('0px')
91 .expect(Selector('[data-test--forms-1]').getStyleProperty('margin-right')).eql('0px')
92 .expect(Selector('[data-test--forms-1]').getStyleProperty('margin-bottom')).eql('0px')
93 .expect(Selector('[data-test--forms-1]').getStyleProperty('margin-left')).eql('0px');
94 });
95
96 test('Text transform should not be inherited.', async t => {
97 await t
98 .expect(Selector('button[data-test--forms-1]').getStyleProperty('text-transform')).eql('none')
99 .expect(Selector('select[data-test--forms-1]').getStyleProperty('text-transform')).eql('none');
100 });
101
102 test('Correct the inability to style clickable types in iOS and Safari.', async t => {
103 await t
104 .expect(Selector('button[data-test--forms-1]').getStyleProperty('-webkit-appearance')).eql(undefined)
105 .expect(Selector('[type="button"][data-test--forms-1]').getStyleProperty('-webkit-appearance')).eql(undefined)
106 .expect(Selector('[type="reset"][data-test--forms-1]').getStyleProperty('-webkit-appearance')).eql(undefined)
107 .expect(Selector('[type="submit"][data-test--forms-1]').getStyleProperty('-webkit-appearance')).eql(undefined);
108 });
109
110 test('Correct the padding in Firefox.', async t => {
111 await t
112 .expect(Selector('fieldset[data-test--forms-2]').getStyleProperty('padding-top')).eql('5.6px')
113 .expect(Selector('fieldset[data-test--forms-2]').getStyleProperty('padding-right')).eql('12px')
114 .expect(Selector('fieldset[data-test--forms-2]').getStyleProperty('padding-bottom')).eql('10px')
115 .expect(Selector('fieldset[data-test--forms-2]').getStyleProperty('padding-left')).eql('12px');
116 });
117
118 test('Remove the padding so developers are not caught out when they zero out `fieldset` elements in all browsers.', async t => {
119 await t
120 .expect(Selector('legend[data-test--forms-2]').getStyleProperty('padding-top')).eql('0px')
121 .expect(Selector('legend[data-test--forms-2]').getStyleProperty('padding-right')).eql('0px')
122 .expect(Selector('legend[data-test--forms-2]').getStyleProperty('padding-bottom')).eql('0px')
123 .expect(Selector('legend[data-test--forms-2]').getStyleProperty('padding-left')).eql('0px');
124 });
125
126 test('Add the correct vertical alignment in Chrome and Firefox.', async t => {
127 await t
128 .expect(Selector('progress[data-test--forms-2]').getStyleProperty('vertical-align')).eql('baseline');
129 });
130
131 test('Correct the cursor style of increment and decrement buttons in Safari.', async t => {
132 // TODO: Pseudo-elements selector not supported by testcafe (See https://github.com/DevExpress/testcafe/issues/2813).
133 });
134
135 test('Correct the odd appearance in Chrome and Safari.', async t => {
136 await t
137 .expect(Selector('[type="search"][data-test--forms-1]').getStyleProperty('-webkit-appearance')).eql(undefined);
138 });
139
140 test('Correct the outline style in Safari.', async t => {
141 await t
142 .expect(Selector('[type="search"][data-test--forms-1]').getStyleProperty('outline-offset')).eql('-2px');
143 });
144
145 test('Remove the inner padding in Chrome and Safari on macOS.', async t => {
146 // TODO: Pseudo-elements selector not supported by testcafe (See https://github.com/DevExpress/testcafe/issues/2813).
147 });
148
149 test('Correct the inability to style clickable types in iOS and Safari.', async t => {
150 // TODO: Pseudo-elements selector not supported by testcafe (See https://github.com/DevExpress/testcafe/issues/2813).
151 });
152
153 test('Change font properties to `inherit` in Safari.', async t => {
154 // TODO: Pseudo-elements selector not supported by testcafe (See https://github.com/DevExpress/testcafe/issues/2813).
155 });
156
157 test('Add the correct display in Chrome and Safari.', async t => {
158 await t
159 .expect(Selector('summary[data-test--interactive]').getStyleProperty('display')).eql('list-item');
160 });