Added Statistics calculation
Statistics now show calculated values
This commit is contained in:
parent
fe87374e47
commit
fc0f69dacb
2147 changed files with 141321 additions and 39 deletions
81
node_modules/mui/source/styles/getMuiTheme.spec.js
generated
vendored
Normal file
81
node_modules/mui/source/styles/getMuiTheme.spec.js
generated
vendored
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
/* eslint-env mocha */
|
||||
|
||||
import {expect} from 'chai';
|
||||
import getMuiTheme from './getMuiTheme';
|
||||
|
||||
describe('./styles/getMuiTheme', () => {
|
||||
// Test backward compatibility
|
||||
it('should work when we use two parameters', () => {
|
||||
const muiTheme = getMuiTheme({
|
||||
palette: {
|
||||
accent1Color: 'Colors.deepOrange500',
|
||||
},
|
||||
}, {
|
||||
userAgent: 'all',
|
||||
appBar: {
|
||||
height: 56,
|
||||
},
|
||||
});
|
||||
|
||||
expect(muiTheme.userAgent).to.equal('all');
|
||||
expect(muiTheme.palette.accent1Color).to.equal('Colors.deepOrange500');
|
||||
expect(muiTheme.appBar.height).to.equal(56);
|
||||
});
|
||||
|
||||
it('should work when we use one parameter', () => {
|
||||
const muiTheme = getMuiTheme({
|
||||
palette: {
|
||||
accent1Color: 'Colors.deepOrange500',
|
||||
},
|
||||
userAgent: 'all',
|
||||
appBar: {
|
||||
height: 56,
|
||||
},
|
||||
});
|
||||
|
||||
expect(muiTheme.userAgent).to.equal('all');
|
||||
expect(muiTheme.palette.accent1Color).to.equal('Colors.deepOrange500');
|
||||
expect(muiTheme.appBar.height).to.equal(56);
|
||||
});
|
||||
|
||||
it('should work when we mutate the muiTheme', () => {
|
||||
const muiTheme1 = getMuiTheme({
|
||||
palette: {
|
||||
accent1Color: 'Colors.deepOrange500',
|
||||
},
|
||||
userAgent: 'all',
|
||||
});
|
||||
|
||||
const muiTheme2 = getMuiTheme(muiTheme1, {
|
||||
palette: {
|
||||
accent1Color: 'Colors.deepOrange600',
|
||||
},
|
||||
appBar: {
|
||||
height: 56,
|
||||
},
|
||||
});
|
||||
|
||||
expect(muiTheme2.userAgent).to.equal('all');
|
||||
expect(muiTheme2.palette.accent1Color).to.equal('Colors.deepOrange600');
|
||||
expect(muiTheme2.appBar.height).to.equal(56);
|
||||
});
|
||||
|
||||
describe('prepareStyles', () => {
|
||||
describe('rtl', () => {
|
||||
it('should revert the rules when isRtl is true', () => {
|
||||
const muiTheme = getMuiTheme({}, {
|
||||
isRtl: true,
|
||||
});
|
||||
|
||||
const stylePrepared = muiTheme.prepareStyles({
|
||||
right: 10,
|
||||
});
|
||||
|
||||
expect(stylePrepared).to.deep.equal({
|
||||
left: 10,
|
||||
muiPrepared: true,
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue