feat: Fluent UI Outlook Lite + connections mockup

This commit is contained in:
Lago committed 2026-04-14 18:52:25 +00:00
1 parent 1199eff6c3
commit dfa4010406
34820 files changed
+1003810 -202

No files matched your search

+121
View File
@@ -0,0 +1,121 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "testDrawerBaseScenarios", {
enumerable: true,
get: function() {
return testDrawerBaseScenarios;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _scriptscypress = require("@fluentui/scripts-cypress");
const _reactprovider = require("@fluentui/react-provider");
const _reacttheme = require("@fluentui/react-theme");
const mountFluent = (element)=>{
(0, _scriptscypress.mount)(/*#__PURE__*/ _react.createElement(_reactprovider.FluentProvider, {
theme: _reacttheme.webLightTheme
}, element));
};
function testDrawerBaseScenarios(Component) {
describe('basic functionality', ()=>{
it('should not render any element when closed', ()=>{
mountFluent(/*#__PURE__*/ _react.createElement(Component, {
id: "drawer"
}));
cy.get('#drawer').should('not.exist');
});
it('should render an element when opened', ()=>{
mountFluent(/*#__PURE__*/ _react.createElement(Component, {
id: "drawer",
open: true
}));
cy.get('#drawer').should('exist');
});
it('should render children content', ()=>{
const content = 'Test the renderization';
mountFluent(/*#__PURE__*/ _react.createElement(Component, {
id: "drawer",
open: true
}, content));
cy.get('#drawer').contains(content);
});
it('should toggle visibility on open prop change', ()=>{
const ExampleDrawer = ()=>{
const [open, setOpen] = _react.useState(false);
return /*#__PURE__*/ _react.createElement(_react.Fragment, null, /*#__PURE__*/ _react.createElement(Component, {
id: "drawer",
open: open
}), /*#__PURE__*/ _react.createElement("button", {
id: "button",
onClick: ()=>setOpen(true)
}, "Open"));
};
mountFluent(/*#__PURE__*/ _react.createElement(ExampleDrawer, null));
cy.get('#drawer').should('not.exist');
cy.get('#button').click();
cy.get('#drawer').should('exist');
});
});
describe('size prop', ()=>{
const sizes = {
small: 320,
medium: 592,
large: 940,
full: 1000
};
Object.entries(sizes).forEach(([size, width])=>{
const sizeProp = size;
it(`should have correct size when size is ${size}`, ()=>{
mountFluent(/*#__PURE__*/ _react.createElement(Component, {
size: sizeProp,
id: "drawer",
open: true
}));
cy.viewport(1000, 1000);
cy.get('#drawer').should('have.css', 'width', width + 'px');
cy.get('#drawer').invoke('outerWidth').should('equal', width);
});
});
it('width should not be bigger than viewport', ()=>{
mountFluent(/*#__PURE__*/ _react.createElement(Component, {
id: "drawer",
open: true
}));
cy.viewport(319, 319);
cy.get('#drawer').should('have.css', 'width', '319px');
cy.get('#drawer').invoke('outerWidth').should('equal', 319);
});
it('should have custom size', ()=>{
mountFluent(/*#__PURE__*/ _react.createElement(Component, {
id: "drawer",
open: true,
style: {
width: '200px'
}
}));
cy.get('#drawer').should('have.css', 'width', '200px');
cy.get('#drawer').invoke('outerWidth').should('equal', 200);
});
});
describe('position prop', ()=>{
const positions = {
start: 'left',
end: 'right',
bottom: 'bottom'
};
Object.entries(positions).forEach(([position, side])=>{
const positionProp = position;
it(`should have correct position when position is ${position}`, ()=>{
mountFluent(/*#__PURE__*/ _react.createElement(Component, {
position: positionProp,
id: "drawer",
open: true
}));
cy.get('#drawer').should('have.css', side, '0px');
});
});
});
}
@@ -0,0 +1 @@
{"version":3,"sources":["../src/e2e/DrawerShared.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { mount } from '@fluentui/scripts-cypress';\nimport { FluentProvider } from '@fluentui/react-provider';\nimport { webLightTheme } from '@fluentui/react-theme';\nimport type { JSXElement } from '@fluentui/react-utilities';\n\nimport { InlineDrawer } from '../components/InlineDrawer';\nimport { OverlayDrawer } from '../components/OverlayDrawer';\nimport { Drawer, DrawerProps } from '../Drawer';\n\nconst mountFluent = (element: JSXElement) => {\n mount(<FluentProvider theme={webLightTheme}>{element}</FluentProvider>);\n};\n\nexport function testDrawerBaseScenarios(Component: typeof Drawer | typeof OverlayDrawer | typeof InlineDrawer): void {\n describe('basic functionality', () => {\n it('should not render any element when closed', () => {\n mountFluent(<Component id=\"drawer\" />);\n\n cy.get('#drawer').should('not.exist');\n });\n\n it('should render an element when opened', () => {\n mountFluent(<Component id=\"drawer\" open />);\n\n cy.get('#drawer').should('exist');\n });\n\n it('should render children content', () => {\n const content = 'Test the renderization';\n mountFluent(\n <Component id=\"drawer\" open>\n {content}\n </Component>,\n );\n\n cy.get('#drawer').contains(content);\n });\n\n it('should toggle visibility on open prop change', () => {\n const ExampleDrawer = () => {\n const [open, setOpen] = React.useState(false);\n\n return (\n <>\n <Component id=\"drawer\" open={open} />\n <button id=\"button\" onClick={() => setOpen(true)}>\n Open\n </button>\n </>\n );\n };\n\n mountFluent(<ExampleDrawer />);\n\n cy.get('#drawer').should('not.exist');\n cy.get('#button').click();\n cy.get('#drawer').should('exist');\n });\n });\n\n describe('size prop', () => {\n const sizes = {\n small: 320,\n medium: 592,\n large: 940,\n full: 1000,\n };\n\n Object.entries(sizes).forEach(([size, width]) => {\n const sizeProp = size as DrawerProps['size'];\n\n it(`should have correct size when size is ${size}`, () => {\n mountFluent(<Component size={sizeProp} id=\"drawer\" open />);\n\n cy.viewport(1000, 1000);\n cy.get('#drawer').should('have.css', 'width', width + 'px');\n cy.get('#drawer').invoke('outerWidth').should('equal', width);\n });\n });\n\n it('width should not be bigger than viewport', () => {\n mountFluent(<Component id=\"drawer\" open />);\n\n cy.viewport(319, 319);\n cy.get('#drawer').should('have.css', 'width', '319px');\n cy.get('#drawer').invoke('outerWidth').should('equal', 319);\n });\n\n it('should have custom size', () => {\n mountFluent(<Component id=\"drawer\" open style={{ width: '200px' }} />);\n\n cy.get('#drawer').should('have.css', 'width', '200px');\n cy.get('#drawer').invoke('outerWidth').should('equal', 200);\n });\n });\n\n describe('position prop', () => {\n const positions = {\n start: 'left',\n end: 'right',\n bottom: 'bottom',\n };\n\n Object.entries(positions).forEach(([position, side]) => {\n const positionProp = position as DrawerProps['position'];\n\n it(`should have correct position when position is ${position}`, () => {\n mountFluent(<Component position={positionProp} id=\"drawer\" open />);\n\n cy.get('#drawer').should('have.css', side, '0px');\n });\n });\n });\n}\n"],"names":["React","mount","FluentProvider","webLightTheme","mountFluent","element","theme","testDrawerBaseScenarios","Component","describe","it","id","cy","get","should","open","content","contains","ExampleDrawer","setOpen","useState","button","onClick","click","sizes","small","medium","large","full","Object","entries","forEach","size","width","sizeProp","viewport","invoke","style","positions","start","end","bottom","position","side","positionProp"],"mappings":"AAAA;;;;;+BAgBgBO;;;;;;;iEAdO,QAAQ;gCACT,4BAA4B;+BACnB,2BAA2B;4BAC5B,wBAAwB;AAOtD,MAAMH,cAAc,CAACC;QACnBJ,qBAAAA,EAAAA,WAAAA,GAAM,OAAA,aAAA,CAACC,6BAAAA,EAAAA;QAAeI,OAAOH,yBAAAA;OAAgBE;AAC/C;AAEO,iCAAiCG,SAAqE;IAC3GC,SAAS,uBAAuB;QAC9BC,GAAG,6CAA6C;YAC9CN,YAAAA,WAAAA,GAAY,OAAA,aAAA,CAACI,WAAAA;gBAAUG,IAAG;;YAE1BC,GAAGC,GAAG,CAAC,WAAWC,MAAM,CAAC;QAC3B;QAEAJ,GAAG,wCAAwC;YACzCN,YAAAA,WAAAA,GAAY,OAAA,aAAA,CAACI,WAAAA;gBAAUG,IAAG;gBAASI,MAAAA;;YAEnCH,GAAGC,GAAG,CAAC,WAAWC,MAAM,CAAC;QAC3B;QAEAJ,GAAG,kCAAkC;YACnC,MAAMM,UAAU;YAChBZ,YAAAA,WAAAA,GACE,OAAA,aAAA,CAACI,WAAAA;gBAAUG,IAAG;gBAASI,MAAAA;eACpBC;YAILJ,GAAGC,GAAG,CAAC,WAAWI,QAAQ,CAACD;QAC7B;QAEAN,GAAG,gDAAgD;YACjD,MAAMQ,gBAAgB;gBACpB,MAAM,CAACH,MAAMI,QAAQ,GAAGnB,OAAMoB,QAAQ,CAAC;gBAEvC,OAAA,WAAA,GACE,OAAA,aAAA,CAAA,OAAA,QAAA,EAAA,MAAA,WAAA,GACE,OAAA,aAAA,CAACZ,WAAAA;oBAAUG,IAAG;oBAASI,MAAMA;kCAC7B,Line truncated