mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-21 06:53:17 +08:00
shorten vitest pie.spec.ts by removing one time use variables
This commit is contained in:
parent
cecf759b0b
commit
3a22d4a501
@ -19,6 +19,7 @@ describe('pie chart', () => {
|
|||||||
parser.parse(`pie
|
parser.parse(`pie
|
||||||
"ash": 100
|
"ash": 100
|
||||||
`);
|
`);
|
||||||
|
|
||||||
const sections = db.getSections();
|
const sections = db.getSections();
|
||||||
expect(sections['ash']).toBe(100);
|
expect(sections['ash']).toBe(100);
|
||||||
});
|
});
|
||||||
@ -76,8 +77,7 @@ describe('pie chart', () => {
|
|||||||
"bat" : 40
|
"bat" : 40
|
||||||
`);
|
`);
|
||||||
|
|
||||||
const title = db.getDiagramTitle();
|
expect(db.getDiagramTitle()).toBe('a 60/40 pie');
|
||||||
expect(title).toBe('a 60/40 pie');
|
|
||||||
|
|
||||||
const sections = db.getSections();
|
const sections = db.getSections();
|
||||||
expect(sections['ash']).toBe(60);
|
expect(sections['ash']).toBe(60);
|
||||||
@ -91,11 +91,9 @@ describe('pie chart', () => {
|
|||||||
"bat" : 40
|
"bat" : 40
|
||||||
`);
|
`);
|
||||||
|
|
||||||
const title = db.getDiagramTitle();
|
expect(db.getDiagramTitle()).toBe('a neat chart');
|
||||||
expect(title).toBe('a neat chart');
|
|
||||||
|
|
||||||
const accTitle = db.getAccTitle();
|
expect(db.getAccTitle()).toBe('a neat acc title');
|
||||||
expect(accTitle).toBe('a neat acc title');
|
|
||||||
|
|
||||||
const sections = db.getSections();
|
const sections = db.getSections();
|
||||||
expect(sections['ash']).toBe(60);
|
expect(sections['ash']).toBe(60);
|
||||||
@ -109,11 +107,9 @@ describe('pie chart', () => {
|
|||||||
"bat" : 40
|
"bat" : 40
|
||||||
`);
|
`);
|
||||||
|
|
||||||
const title = db.getDiagramTitle();
|
expect(db.getDiagramTitle()).toBe('a neat chart');
|
||||||
expect(title).toBe('a neat chart');
|
|
||||||
|
|
||||||
const description = db.getAccDescription();
|
expect(db.getAccDescription()).toBe('a neat description');
|
||||||
expect(description).toBe('a neat description');
|
|
||||||
|
|
||||||
const sections = db.getSections();
|
const sections = db.getSections();
|
||||||
expect(sections['ash']).toBe(60);
|
expect(sections['ash']).toBe(60);
|
||||||
@ -130,11 +126,9 @@ describe('pie chart', () => {
|
|||||||
"bat" : 40
|
"bat" : 40
|
||||||
`);
|
`);
|
||||||
|
|
||||||
const title = db.getDiagramTitle();
|
expect(db.getDiagramTitle()).toBe('a neat chart');
|
||||||
expect(title).toBe('a neat chart');
|
|
||||||
|
|
||||||
const description = db.getAccDescription();
|
expect(db.getAccDescription()).toBe('a neat description\non multiple lines');
|
||||||
expect(description).toBe('a neat description\non multiple lines');
|
|
||||||
|
|
||||||
const sections = db.getSections();
|
const sections = db.getSections();
|
||||||
expect(sections['ash']).toBe(60);
|
expect(sections['ash']).toBe(60);
|
||||||
@ -165,8 +159,10 @@ describe('pie chart', () => {
|
|||||||
describe('config', () => {
|
describe('config', () => {
|
||||||
it('setConfig', () => {
|
it('setConfig', () => {
|
||||||
db.setConfig({ useWidth: 850, useMaxWidth: undefined });
|
db.setConfig({ useWidth: 850, useMaxWidth: undefined });
|
||||||
expect(db.getConfig().useWidth).toBe(850);
|
|
||||||
expect(db.getConfig().useMaxWidth).toBeTruthy();
|
const config = db.getConfig();
|
||||||
|
expect(config.useWidth).toBe(850);
|
||||||
|
expect(config.useMaxWidth).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('getConfig', () => {
|
it('getConfig', () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user