fix(i18n): chinese test suite (#38220)
* fix: Chinese test suite Add localeTiltes, descriptions, and adjust test text and testStrings to get the automated test suite working. * fix: ran script, updated testStrings and solutions
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
6a7a7e6d7d
commit
b3213fc892
@ -24,19 +24,19 @@ localeTitle: 在推文中添加弹性盒子布局
|
||||
```yml
|
||||
tests:
|
||||
- text: '<code>header</code>的<code>display</code>属性应为 flex。'
|
||||
testString: assert($('header').css('display') == 'flex', '<code>header</code>的<code>display</code>属性应为 flex。');
|
||||
testString: assert($('header').css('display') == 'flex');
|
||||
- text: '<code>footer</code>的<code>display</code>属性应为 flex。'
|
||||
testString: assert($('footer').css('display') == 'flex', '<code>footer</code>的<code>display</code>属性应为 flex。');
|
||||
testString: assert($('footer').css('display') == 'flex');
|
||||
- text: '<code>h3</code>的<code>display</code>属性应为 flex。'
|
||||
testString: assert($('h3').css('display') == 'flex', '<code>h3</code>的<code>display</code>属性应为 flex。');
|
||||
testString: assert($('h3').css('display') == 'flex');
|
||||
- text: '<code>h4</code>的<code>display</code>属性应为 flex。'
|
||||
testString: assert($('h4').css('display') == 'flex', '<code>h4</code>的<code>display</code>属性应为 flex。');
|
||||
testString: assert($('h4').css('display') == 'flex');
|
||||
- text: '<code>.profile-name</code>的<code>display</code>属性应为 flex。'
|
||||
testString: assert($('.profile-name').css('display') == 'flex', '<code>.profile-name</code>的<code>display</code>属性应为 flex。');
|
||||
testString: assert($('.profile-name').css('display') == 'flex');
|
||||
- text: '<code>.follow-btn</code>的<code>display</code>属性应为 flex。'
|
||||
testString: assert($('.follow-btn').css('display') == 'flex', '<code>.follow-btn</code>的<code>display</code>属性应为 flex。');
|
||||
testString: assert($('.follow-btn').css('display') == 'flex');
|
||||
- text: '<code>.stats</code>的<code>display</code>属性应为 flex。'
|
||||
testString: assert($('.stats').css('display') == 'flex', '<code>.stats</code>的<code>display</code>属性应为 flex。');
|
||||
testString: assert($('.stats').css('display') == 'flex');
|
||||
|
||||
```
|
||||
|
||||
|
@ -28,7 +28,7 @@ Flex 容器中,与主轴垂直的叫做 <strong>cross axis(交叉轴)</str
|
||||
```yml
|
||||
tests:
|
||||
- text: '<code>#box-container</code>元素应有<code>align-items</code>属性,其值应为 center。'
|
||||
testString: assert($('#box-container').css('align-items') == 'center', '<code>#box-container</code>元素应有<code>align-items</code>属性,其值应为 center。');
|
||||
testString: assert($('#box-container').css('align-items') == 'center');
|
||||
|
||||
```
|
||||
|
||||
|
@ -29,7 +29,7 @@ flex 子元素有时不能充满整个 flex 容器,所以我们经常需要告
|
||||
```yml
|
||||
tests:
|
||||
- text: '<code>#box-container</code>应有<code>justify-content</code>属性,其值应为 center。'
|
||||
testString: assert($('#box-container').css('justify-content') == 'center', '<code>#box-container</code>应有<code>justify-content</code>属性,其值应为 center。');
|
||||
testString: assert($('#box-container').css('justify-content') == 'center');
|
||||
|
||||
```
|
||||
|
||||
|
@ -23,7 +23,7 @@ localeTitle: 使用 flex-direction 在嵌入推文中创建一列
|
||||
```yml
|
||||
tests:
|
||||
- text: '<code>.profile-name</code>应有<code>flex-direction</code>属性,其值应为 column。'
|
||||
testString: assert($('.profile-name').css('flex-direction') == 'column', '<code>.profile-name</code>应有<code>flex-direction</code>属性,其值应为 column。');
|
||||
testString: assert($('.profile-name').css('flex-direction') == 'column');
|
||||
|
||||
```
|
||||
|
||||
|
@ -23,9 +23,9 @@ localeTitle: 使用 flex-direction 在嵌入推文中创建多行
|
||||
```yml
|
||||
tests:
|
||||
- text: '<code>header</code>应有<code>flex-direction</code>属性,其值应为 row。'
|
||||
testString: 'assert(code.match(/header\s*?{\s*?.*?\s*?.*?\s*?flex-direction:\s*?row;/g), ''<code>header</code>应有<code>flex-direction</code>属性,其值应为 row。'');'
|
||||
testString: assert(code.match(/header\s*?{[^}]*?flex-direction:\s*?row;/g));
|
||||
- text: '<code>footer</code>应有<code>flex-direction</code>属性,其值应为 row。'
|
||||
testString: 'assert(code.match(/footer\s*?{\s*?.*?\s*?.*?\s*?flex-direction:\s*?row;/g), ''<code>footer</code>应有<code>flex-direction</code>属性,其值应为 row。'');'
|
||||
testString: assert(code.match(/footer\s*?{[^}]*?flex-direction:\s*?row;/g));
|
||||
|
||||
```
|
||||
|
||||
|
@ -24,7 +24,7 @@ localeTitle: '使用 display: flex 定位两个盒子'
|
||||
```yml
|
||||
tests:
|
||||
- text: '<code>#box-container</code>应有<code>display</code>属性,其值应为 flex。'
|
||||
testString: assert($('#box-container').css('display') == 'flex', '<code>#box-container</code>应有<code>display</code>属性,其值应为 flex。');
|
||||
testString: assert($('#box-container').css('display') == 'flex');
|
||||
|
||||
```
|
||||
|
||||
|
@ -23,7 +23,7 @@ localeTitle: 在推文中使用 align-items 属性
|
||||
```yml
|
||||
tests:
|
||||
- text: '<code>.follow-btn</code>应有<code>align-items</code>属性,其值应为 center.'
|
||||
testString: assert($('.follow-btn').css('align-items') == 'center', '<code>.follow-btn</code>应有<code>align-items</code>属性,其值应为 center.');
|
||||
testString: assert($('.follow-btn').css('align-items') == 'center');
|
||||
|
||||
```
|
||||
|
||||
|
@ -24,9 +24,9 @@ flex 子项目的最后一个属性是<code>align-self</code>。这个属性允
|
||||
```yml
|
||||
tests:
|
||||
- text: '<code>#box-1</code>元素应有<code>align-self</code>属性,其值应为 center。'
|
||||
testString: assert($('#box-1').css('align-self') == 'center', '<code>#box-1</code>元素应有<code>align-self</code>属性,其值应为 center。');
|
||||
testString: assert($('#box-1').css('align-self') == 'center');
|
||||
- text: '<code>#box-2</code>元素应有<code>align-self</code>属性,其值应为 flex-end。'
|
||||
testString: assert($('#box-2').css('align-self') == 'flex-end', '<code>#box-2</code>元素应有<code>align-self</code>属性,其值应为 flex-end。');
|
||||
testString: assert($('#box-2').css('align-self') == 'flex-end');
|
||||
|
||||
```
|
||||
|
||||
|
@ -24,13 +24,13 @@ localeTitle: 使用 flex-basis 属性设置项目的初始大小
|
||||
```yml
|
||||
tests:
|
||||
- text: '<code>#box-1</code>元素应有<code>flex-basis</code>属性。'
|
||||
testString: assert($('#box-1').css('flex-basis') != 'auto', '<code>#box-1</code>元素应有<code>flex-basis</code>属性。');
|
||||
testString: assert($('#box-1').css('flex-basis') != 'auto');
|
||||
- text: '<code>#box-1</code>的<code>flex-basis</code>应为<code>10em</code>。'
|
||||
testString: 'assert(code.match(/#box-1\s*?{\s*?.*?\s*?.*?\s*?flex-basis:\s*?10em;/g), ''<code>#box-1</code>的<code>flex-basis</code>应为<code>10em</code>。'');'
|
||||
testString: assert(code.match(/#box-1\s*?{\s*?.*?\s*?.*?\s*?flex-basis:\s*?10em;/g));
|
||||
- text: '<code>#box-2</code>元素应有<code>flex-basis</code>属性。'
|
||||
testString: assert($('#box-2').css('flex-basis') != 'auto', '<code>#box-2</code>元素应有<code>flex-basis</code>属性。');
|
||||
testString: assert($('#box-2').css('flex-basis') != 'auto');
|
||||
- text: '<code>#box-2</code>的<code>flex-basis</code>应为<code>20em</code>。'
|
||||
testString: 'assert(code.match(/#box-2\s*?{\s*?.*?\s*?.*?\s*?flex-basis:\s*?20em;/g), ''<code>#box-2</code>的<code>flex-basis</code>应为<code>20em</code>。'');'
|
||||
testString: assert(code.match(/#box-2\s*?{\s*?.*?\s*?.*?\s*?flex-basis:\s*?20em;/g));
|
||||
|
||||
```
|
||||
|
||||
|
@ -23,7 +23,7 @@ localeTitle: 使用 flex-direction 属性创建一列
|
||||
```yml
|
||||
tests:
|
||||
- text: '<code>#box-container</code>应有<code>flex-direction</code>属性,其值应为 column。'
|
||||
testString: assert($('#box-container').css('flex-direction') == 'column', '<code>#box-container</code>应有<code>flex-direction</code>属性,其值应为 column。');
|
||||
testString: assert($('#box-container').css('flex-direction') == 'column');
|
||||
|
||||
```
|
||||
|
||||
|
@ -25,7 +25,7 @@ localeTitle: 使用 flex-direction 属性创建一行
|
||||
```yml
|
||||
tests:
|
||||
- text: '<code>#box-container</code>应有<code>flex-direction</code>属性,其值应为 row-reverse。'
|
||||
testString: assert($('#box-container').css('flex-direction') == 'row-reverse', '<code>#box-container</code>应有<code>flex-direction</code>属性,其值应为 row-reverse。');
|
||||
testString: assert($('#box-container').css('flex-direction') == 'row-reverse');
|
||||
|
||||
```
|
||||
|
||||
|
@ -24,9 +24,9 @@ localeTitle: 使用 flex-grow 属性扩展项目
|
||||
```yml
|
||||
tests:
|
||||
- text: '<code>#box-1</code>元素应有<code>flex-grow</code>属性,其值应为 1。'
|
||||
testString: assert($('#box-1').css('flex-grow') == '1', '<code>#box-1</code>元素应有<code>flex-grow</code>属性,其值应为 1。');
|
||||
testString: assert($('#box-1').css('flex-grow') == '1');
|
||||
- text: '<code>#box-2</code>元素应有<code>flex-grow</code>属性,其值应为 2。'
|
||||
testString: assert($('#box-2').css('flex-grow') == '2', '<code>#box-2</code>元素应有<code>flex-grow</code>属性,其值应为 2。');
|
||||
testString: assert($('#box-2').css('flex-grow') == '2');
|
||||
|
||||
```
|
||||
|
||||
|
@ -26,11 +26,11 @@ localeTitle: 使用 flex 短方法属性
|
||||
```yml
|
||||
tests:
|
||||
- text: '<code>#box-1</code>元素应有<code>flex</code>属性,其值应为 2 2 150px。'
|
||||
testString: assert($('#box-1').css('flex-grow') == '2' && $('#box-1').css('flex-shrink') == '2' && $('#box-1').css('flex-basis') == '150px', '<code>#box-1</code>元素应有<code>flex</code>属性,其值应为 2 2 150px。');
|
||||
testString: assert($('#box-1').css('flex-grow') == '2' && $('#box-1').css('flex-shrink') == '2' && $('#box-1').css('flex-basis') == '150px');
|
||||
- text: '<code>#box-2</code>元素应有<code>flex</code>属性,其值应为 1 1 150px。'
|
||||
testString: assert($('#box-2').css('flex-grow') == '1' && $('#box-2').css('flex-shrink') == '1' && $('#box-2').css('flex-basis') == '150px', '<code>#box-2</code>元素应有<code>flex</code>属性,其值应为 1 1 150px。');
|
||||
testString: assert($('#box-2').css('flex-grow') == '1' && $('#box-2').css('flex-shrink') == '1' && $('#box-2').css('flex-basis') == '150px');
|
||||
- text: '应对<code>#box-1</code>和<code>#box-2</code>使用<code>flex</code>属性。'
|
||||
testString: 'assert(code.match(/flex:\s*?\d\s+?\d\s+?150px;/g).length == 2, ''应对<code>#box-1</code>和<code>#box-2</code>使用<code>flex</code>属性。'');'
|
||||
testString: assert(code.match(/flex:\s*?\d\s+?\d\s+?150px;/g).length == 2);
|
||||
|
||||
```
|
||||
|
||||
|
@ -25,9 +25,9 @@ localeTitle: 使用 flex-shrink 属性收缩项目
|
||||
```yml
|
||||
tests:
|
||||
- text: '<code>#box-1</code>元素应有<code>flex-shrink</code>属性,其值应为 1.'
|
||||
testString: assert($('#box-1').css('flex-shrink') == '1', '<code>#box-1</code>元素应有<code>flex-shrink</code>属性,其值应为 1.');
|
||||
testString: assert($('#box-1').css('flex-shrink') == '1');
|
||||
- text: '<code>#box-2</code>元素应有<code>flex-shrink</code>属性,其值应为 2.'
|
||||
testString: assert($('#box-2').css('flex-shrink') == '2', '<code>#box-2</code>元素应有<code>flex-shrink</code>属性,其值应为 2.');
|
||||
testString: assert($('#box-2').css('flex-shrink') == '2');
|
||||
|
||||
```
|
||||
|
||||
|
@ -26,7 +26,7 @@ CSS flexbox 有一个把 flex 子元素拆分为多行(或多列)的特性
|
||||
```yml
|
||||
tests:
|
||||
- text: '<code>#box-container</code>元素应有<code>flex-wrap</code>属性,其值应为 wrap。'
|
||||
testString: assert($('#box-container').css('flex-wrap') == 'wrap', '<code>#box-container</code>元素应有<code>flex-wrap</code>属性,其值为 wrap。');
|
||||
testString: assert($('#box-container').css('flex-wrap') == 'wrap');
|
||||
|
||||
```
|
||||
|
||||
|
@ -23,7 +23,7 @@ localeTitle: 在推文中使用 justify-content 属性
|
||||
```yml
|
||||
tests:
|
||||
- text: '<code>.profile-name</code>元素的<code>justify-content</code>属性可选以下值:center、flex-start、flex-end、space-between、space-around。'
|
||||
testString: 'assert(code.match(/header\s.profile-name\s*{\s*?.*?\s*?.*?\s*?\s*?.*?\s*?justify-content\s*:\s*(center|flex-start|flex-end|space-between|space-around)\s*;/g), ''<code>.profile-name</code>元素的<code>justify-content</code>属性可选以下值:center、flex-start、flex-end、space-between、space-around。'');'
|
||||
testString: 'assert(code.match(/header\s.profile-name\s*{\s*?.*?\s*?.*?\s*?\s*?.*?\s*?justify-content\s*:\s*(center|flex-start|flex-end|space-between|space-around|space-evenly)\s*;/g));'
|
||||
|
||||
```
|
||||
|
||||
|
@ -23,9 +23,9 @@ localeTitle: 使用 order 属性重新排列项目
|
||||
```yml
|
||||
tests:
|
||||
- text: '<code>#box-1</code>元素应有<code>order</code>属性,其值应为 2。'
|
||||
testString: assert($('#box-1').css('order') == '2', '<code>#box-1</code>元素应有<code>order</code>属性,其值应为 2。');
|
||||
testString: assert($('#box-1').css('order') == '2');
|
||||
- text: '<code>#box-2</code>元素应有<code>order</code>属性,其值应为 1。'
|
||||
testString: assert($('#box-2').css('order') == '1', '<code>#box-2</code>元素应有<code>order</code>属性,其值应为 1。');
|
||||
testString: assert($('#box-2').css('order') == '1');
|
||||
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user