fix: match Today paper concept
This commit is contained in:
@@ -39,33 +39,42 @@ describe('Today environment integration', () => {
|
||||
})
|
||||
|
||||
it('keeps mobile environment copy to two rows including refresh states', () => {
|
||||
expect(css).toMatch(/@container\(max-width:559px\)\{\.today-environment\{[^}]*grid-template-rows:40px 66px/)
|
||||
expect(css).toMatch(/\.today-environment__status\{[^}]*grid-column:auto;grid-row:auto/)
|
||||
expect(css).toMatch(/@media\(max-width:720px\)\{\.today-environment\{[^}]*grid-template-rows:auto auto/)
|
||||
expect(css).not.toMatch(/\.today-board\{[^}]*grid-template-rows:/)
|
||||
expect(css).not.toContain('@container(max-width:720px){.today-environment')
|
||||
expect(css).not.toContain('@container(min-width:721px){.today-environment')
|
||||
expect(css).not.toContain('.today-environment__refreshing')
|
||||
})
|
||||
|
||||
it('renders方案 A as one labelled paper surface with a grouped progress region', () => {
|
||||
it('renders方案 A as the selected landing-page paper composition', () => {
|
||||
expect(app.match(/class="today-board"/g)).toHaveLength(1)
|
||||
expect(app).toContain('<section v-if="activeView===\'today\'" class="today-board" aria-labelledby="today-board-title">')
|
||||
expect(app).toContain('<h2 id="today-board-title" class="sr-only">今日纸笺</h2>')
|
||||
expect(app).toContain('<div class="today-board__progress" aria-label="今日任务与习惯进度">')
|
||||
expect(app).toContain('<span>还有 {{ todayTaskRemaining }} 项</span>')
|
||||
expect(app).toContain('<span>还有 {{ todayHabitRemaining }} 项</span>')
|
||||
expect(app).toMatch(/today-board__progress[\s\S]*today-task-track[\s\S]*today-habit-track[\s\S]*<\/div>/)
|
||||
expect(css).toMatch(/\.today-board\{[^}]*grid-template-rows:76px 62px[^}]*gap:1px/)
|
||||
expect(css).toMatch(/\.today-board__progress\{[^}]*min-height:62px[^}]*display:grid[^}]*grid-template-columns:repeat\(2,minmax\(0,1fr\)\)/)
|
||||
expect(css).toContain('@media(max-width:559px){.today-board{grid-template-rows:106px 70px;padding:0 12px}.today-board__progress{min-height:70px}')
|
||||
expect(css).toMatch(/\.today-board\{[^}]*padding:0 18px 16px/)
|
||||
expect(css).toMatch(/\.today-board__progress\{[^}]*display:grid[^}]*grid-template-columns:repeat\(2,minmax\(0,1fr\)\)/)
|
||||
expect(css).toContain('.today-track:first-child{padding-left:0;padding-right:18px}')
|
||||
expect(css).toContain('.today-track:last-child{padding-right:0;padding-left:18px;border-left:1px solid var(--line)}')
|
||||
expect(css).not.toMatch(/@media\(max-width:720px\)\{\.today-board\{[^}]*padding:/)
|
||||
expect(css).not.toMatch(/@media\(max-width:930px\)[\s\S]*?\.today-track-head\{[^}]*flex-direction:column/)
|
||||
expect(css).toContain('.today-track-rail{display:block;height:5px;overflow:hidden;border-radius:999px;background:#eee5d9}')
|
||||
expect(css).toContain('.today-track-fill{display:block;width:0;height:100%;border-radius:inherit;background:var(--success)')
|
||||
expect(css).not.toMatch(/\.today-(?:board|track)[^{]*\{[^}]*(?:gradient|backdrop-filter)/)
|
||||
})
|
||||
|
||||
it('keeps the editorial environment layout readable at desktop and narrow widths', () => {
|
||||
expect(css).toMatch(/\.today-environment\{[^}]*grid-column:1\/-1/)
|
||||
expect(css).toMatch(/@container\(min-width:560px\)\{\.today-environment\{[^}]*grid-template-columns:minmax\(0,1\.45fr\) minmax\(0,1fr\) minmax\(0,1fr\)/)
|
||||
expect(css).toMatch(/\.today-environment__calendar strong\{[^}]*font-size:25px/)
|
||||
expect(css).toMatch(/@container\(max-width:559px\)\{\.today-environment\{[^}]*grid-template-columns:minmax\(0,1fr\) minmax\(0,1fr\)[^}]*grid-template-rows:40px 66px/)
|
||||
expect(css).toMatch(/@media\(min-width:721px\)\{\.today-environment\{[^}]*grid-template-columns:minmax\(0,1\.25fr\) minmax\(0,1fr\) minmax\(0,1fr\)/)
|
||||
expect(css).toMatch(/\.today-environment__calendar strong\{[^}]*font-size:23px/)
|
||||
expect(css).toMatch(/@media\(max-width:720px\)\{\.today-environment\{[^}]*grid-template-columns:minmax\(0,1fr\) minmax\(0,1fr\)[^}]*grid-template-rows:auto auto/)
|
||||
expect(css).toMatch(/\.today-environment__calendar\{[^}]*grid-column:1\/-1[^}]*grid-row:1/)
|
||||
expect(css).toMatch(/\.today-environment__weather\{[^}]*grid-column:1[^}]*grid-row:2/)
|
||||
expect(css).toMatch(/\.today-environment__gold\{[^}]*grid-column:2[^}]*grid-row:2/)
|
||||
expect(css).toMatch(/\.today-environment__weather,\.today-environment__gold\{[^}]*flex-direction:column/)
|
||||
expect(css).not.toMatch(/\.today-environment[^}]*overflow-x:auto/)
|
||||
expect(css).not.toMatch(/@container\(max-width:559px\)[\s\S]*?\.today-environment[^}]*text-overflow:ellipsis/)
|
||||
expect(css).not.toMatch(/@media\(max-width:720px\)[\s\S]*?\.today-environment[^}]*text-overflow:ellipsis/)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user