Skip to content

Commit

Permalink
test: update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
beeman committed Dec 3, 2023
1 parent d84fd11 commit e478daf
Show file tree
Hide file tree
Showing 5 changed files with 1,162 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,93 @@ exports[`component generator should create files for header 1`] = `
}
`;

exports[`component generator should create files for layout 1`] = `
{
".prettierrc": {
"content": [
"{ "singleQuote": true }",
],
"isBinary": false,
"path": "./.prettierrc",
},
"nx.json": {
"content": [
"{",
""affected": { "defaultBase": "main" },",
""targetDefaults": {",
""build": { "cache": true },",
""lint": { "cache": true },",
""e2e": { "cache": true }",
"}",
"}",
],
"isBinary": false,
"path": "./nx.json",
},
"package.json": {
"content": [
"{",
""name": "@proj/source",",
""dependencies": {},",
""devDependencies": {}",
"}",
],
"isBinary": false,
"path": "./package.json",
},
"test": {
"children": {
"index.ts": {
"content": [
"export * from './ui-layout';",
],
"isBinary": false,
"path": "./test/index.ts",
},
"ui-layout.tsx": {
"content": [
"import { AppShell, AppShellProps, Loader, rem } from '@mantine/core';",
"import { ReactNode, Suspense } from 'react';",
"export function UiLayout({",
"children,",
"header,",
"headerHeight = rem(56),",
"...props",
"}: Omit<AppShellProps, 'header'> & {",
"children: ReactNode;",
"header: ReactNode;",
"headerHeight?: string;",
"}) {",
"return (",
"<AppShell header={{ height: headerHeight }} padding="md" {...props}>",
"<AppShell.Header>{header}</AppShell.Header>",
"<AppShell.Main>",
"<Suspense fallback={<Loader />}>{children}</Suspense>",
"</AppShell.Main>",
"</AppShell>",
");",
"}",
],
"isBinary": false,
"path": "./test/ui-layout.tsx",
},
},
"path": "./test",
},
"tsconfig.base.json": {
"content": [
"{",
""compilerOptions": {",
""paths": {}",
"}",
"}",
],
"isBinary": false,
"path": "./tsconfig.base.json",
},
}
`;

exports[`component generator should create files for logo 1`] = `
{
".prettierrc": {
Expand Down Expand Up @@ -1641,6 +1728,104 @@ exports[`component generator should create files for theme 1`] = `
}
`;

exports[`component generator should create files for theme-switch 1`] = `
{
".prettierrc": {
"content": [
"{ "singleQuote": true }",
],
"isBinary": false,
"path": "./.prettierrc",
},
"nx.json": {
"content": [
"{",
""affected": { "defaultBase": "main" },",
""targetDefaults": {",
""build": { "cache": true },",
""lint": { "cache": true },",
""e2e": { "cache": true }",
"}",
"}",
],
"isBinary": false,
"path": "./nx.json",
},
"package.json": {
"content": [
"{",
""name": "@proj/source",",
""dependencies": {},",
""devDependencies": {}",
"}",
],
"isBinary": false,
"path": "./package.json",
},
"test": {
"children": {
"index.ts": {
"content": [
"export * from './ui-theme-switch';",
],
"isBinary": false,
"path": "./test/index.ts",
},
"ui-theme-switch.tsx": {
"content": [
"import { rem, Switch, SwitchProps, useMantineTheme } from '@mantine/core';",
"import { IconMoonStars, IconSun } from '@tabler/icons-react';",
"import { useUiColorScheme } from '../ui-theme';",
"export function UiThemeSwitch(props: SwitchProps) {",
"const theme = useMantineTheme();",
"const sunIcon = (",
"<IconSun",
"style={{ width: rem(16), height: rem(16) }}",
"stroke={2.5}",
"color={theme.colors.yellow[4]}",
"/>",
");",
"const moonIcon = (",
"<IconMoonStars",
"style={{ width: rem(16), height: rem(16) }}",
"stroke={2.5}",
"color={theme.colors.brand[6]}",
"/>",
");",
"const { toggleColorScheme, colorScheme } = useUiColorScheme();",
"return (",
"<Switch",
"size="lg"",
"color={'dark.6'}",
"onLabel={sunIcon}",
"offLabel={moonIcon}",
"onChange={() => toggleColorScheme()}",
"checked={colorScheme === 'dark'}",
"{...props}",
"/>",
");",
"}",
],
"isBinary": false,
"path": "./test/ui-theme-switch.tsx",
},
},
"path": "./test",
},
"tsconfig.base.json": {
"content": [
"{",
""compilerOptions": {",
""paths": {}",
"}",
"}",
],
"isBinary": false,
"path": "./tsconfig.base.json",
},
}
`;

exports[`component generator should create files for time 1`] = `
{
".prettierrc": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ exports[`components generator should run successfully 1`] = `
"export * from './ui-debug';",
"export * from './ui-group';",
"export * from './ui-header';",
"export * from './ui-layout';",
"export * from './ui-logo';",
"export * from './ui-menu';",
"export * from './ui-search-input';",
"export * from './ui-stack';",
"export * from './ui-tab-routes';",
"export * from './ui-theme';",
"export * from './ui-theme-switch';",
"export * from './ui-time';",
"export * from './ui-toast';",
],
Expand Down Expand Up @@ -511,6 +513,45 @@ exports[`components generator should run successfully 1`] = `
},
"path": "./test/ui-header",
},
"ui-layout": {
"children": {
"index.ts": {
"content": [
"export * from './ui-layout';",
],
"isBinary": false,
"path": "./test/ui-layout/index.ts",
},
"ui-layout.tsx": {
"content": [
"import { AppShell, AppShellProps, Loader, rem } from '@mantine/core';",
"import { ReactNode, Suspense } from 'react';",
"export function UiLayout({",
"children,",
"header,",
"headerHeight = rem(56),",
"...props",
"}: Omit<AppShellProps, 'header'> & {",
"children: ReactNode;",
"header: ReactNode;",
"headerHeight?: string;",
"}) {",
"return (",
"<AppShell header={{ height: headerHeight }} padding="md" {...props}>",
"<AppShell.Header>{header}</AppShell.Header>",
"<AppShell.Main>",
"<Suspense fallback={<Loader />}>{children}</Suspense>",
"</AppShell.Main>",
"</AppShell>",
");",
"}",
],
"isBinary": false,
"path": "./test/ui-layout/ui-layout.tsx",
},
},
"path": "./test/ui-layout",
},
"ui-logo": {
"children": {
"index.ts": {
Expand Down Expand Up @@ -1074,6 +1115,56 @@ exports[`components generator should run successfully 1`] = `
},
"path": "./test/ui-theme",
},
"ui-theme-switch": {
"children": {
"index.ts": {
"content": [
"export * from './ui-theme-switch';",
],
"isBinary": false,
"path": "./test/ui-theme-switch/index.ts",
},
"ui-theme-switch.tsx": {
"content": [
"import { rem, Switch, SwitchProps, useMantineTheme } from '@mantine/core';",
"import { IconMoonStars, IconSun } from '@tabler/icons-react';",
"import { useUiColorScheme } from '../ui-theme';",
"export function UiThemeSwitch(props: SwitchProps) {",
"const theme = useMantineTheme();",
"const sunIcon = (",
"<IconSun",
"style={{ width: rem(16), height: rem(16) }}",
"stroke={2.5}",
"color={theme.colors.yellow[4]}",
"/>",
");",
"const moonIcon = (",
"<IconMoonStars",
"style={{ width: rem(16), height: rem(16) }}",
"stroke={2.5}",
"color={theme.colors.brand[6]}",
"/>",
");",
"const { toggleColorScheme, colorScheme } = useUiColorScheme();",
"return (",
"<Switch",
"size="lg"",
"color={'dark.6'}",
"onLabel={sunIcon}",
"offLabel={moonIcon}",
"onChange={() => toggleColorScheme()}",
"checked={colorScheme === 'dark'}",
"{...props}",
"/>",
");",
"}",
],
"isBinary": false,
"path": "./test/ui-theme-switch/ui-theme-switch.tsx",
},
},
"path": "./test/ui-theme-switch",
},
"ui-time": {
"children": {
"index.ts": {
Expand Down
Loading

0 comments on commit e478daf

Please sign in to comment.