1
0
Fork 0

Added Statistics calculation

Statistics now show calculated values
This commit is contained in:
Techognito 2025-09-04 17:30:00 +02:00
parent fe87374e47
commit fc0f69dacb
2147 changed files with 141321 additions and 39 deletions

90
node_modules/mui/source/elements/Paper/Paper.spec.js generated vendored Normal file
View file

@ -0,0 +1,90 @@
/* eslint-env mocha */
import React from 'react';
import {shallow} from 'enzyme';
import {assert} from 'chai';
import Paper from './Paper';
import getMuiTheme from '../styles/getMuiTheme';
describe('<Paper />', () => {
const muiTheme = getMuiTheme();
const shallowWithContext = (node) => shallow(node, {context: {muiTheme}});
const testChildren = <div className="unique">Hello World</div>;
it('renders children by default', () => {
const wrapper = shallowWithContext(
<Paper>{testChildren}</Paper>
);
assert.ok(wrapper.contains(testChildren), 'should contain the children');
});
it('renders children and have borderRadius by default', () => {
const wrapper = shallowWithContext(
<Paper>{testChildren}</Paper>
);
assert.ok(wrapper.contains(testChildren), 'should contain the children');
assert.strictEqual(wrapper.prop('style').borderRadius, 2, 'should have round corner');
});
it('renders children and should be a circle', () => {
const wrapper = shallowWithContext(
<Paper circle={true}>{testChildren}</Paper>
);
assert.ok(wrapper.contains(testChildren), 'should contain the children');
assert.strictEqual(wrapper.prop('style').borderRadius, '50%', 'should be a circle');
});
it('renders children and does not have rounded corners', () => {
const wrapper = shallowWithContext(
<Paper rounded={false}>{testChildren}</Paper>
);
assert.ok(wrapper.contains(testChildren), 'should contain the children');
assert.strictEqual(wrapper.prop('style').borderRadius, '0px', 'should not have borderRadius');
});
it('renders children and overwrite styles', () => {
const style = {
backgroundColor: 'red',
borderRadius: '70px',
};
const wrapper = shallowWithContext(
<Paper style={style}>{testChildren}</Paper>
);
assert.ok(wrapper.contains(testChildren), 'should contain the children');
assert.strictEqual(wrapper.prop('style').backgroundColor, 'red', 'should have red backgroundColor');
assert.strictEqual(wrapper.prop('style').borderRadius, '70px', 'should have borderRadius');
});
it('renders children and has css transitions by default', () => {
const wrapper = shallowWithContext(
<Paper>{testChildren}</Paper>
);
assert.ok(wrapper.contains(testChildren), 'should contain the children');
assert.ok(wrapper.prop('style').transition, 'should have css transitions');
});
it('renders children and disable css transitions', () => {
const wrapper = shallowWithContext(
<Paper transitionEnabled={false}>{testChildren}</Paper>
);
assert.ok(wrapper.contains(testChildren), 'should contain the children');
assert.isNotOk(wrapper.prop('style').transition, 'should not have css transitions');
});
it('renders children and change zDepth', () => {
const zDepth = 3;
const wrapper = shallowWithContext(
<Paper zDepth={zDepth}>{testChildren}</Paper>
);
assert.ok(wrapper.contains(testChildren), 'should contain the children');
assert.strictEqual(wrapper.prop('style').boxShadow, muiTheme.paper.zDepthShadows[zDepth - 1],
'should have good zDepthShadows');
});
});