mirror of
https://github.com/gromlab-ru/svg-sprites.git
synced 2026-07-22 04:40:17 +03:00
test: добавить площадку интеграционного тестирования
- добавлены consumer fixtures для React и Next.js - добавлены typecheck, production build и браузерные smoke-тесты - добавлена интеграционная проверка в CI
This commit is contained in:
6
integration/apps/react-webpack/src/env.d.ts
vendored
Normal file
6
integration/apps/react-webpack/src/env.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
declare module '*.module.css' {
|
||||
const classes: Record<string, string>
|
||||
export default classes
|
||||
}
|
||||
|
||||
declare module '*.css'
|
||||
22
integration/apps/react-webpack/src/main.tsx
Normal file
22
integration/apps/react-webpack/src/main.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { StrictMode } from 'react'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
|
||||
import { IconsIcon } from './sprite'
|
||||
import './style.css'
|
||||
|
||||
createRoot(document.getElementById('root')!).render(
|
||||
<StrictMode>
|
||||
<main>
|
||||
<h1>React + Webpack</h1>
|
||||
<IconsIcon
|
||||
data-testid="icon"
|
||||
data-app="react-webpack"
|
||||
icon="check"
|
||||
aria-label="Check icon"
|
||||
width={64}
|
||||
height={64}
|
||||
style={{ '--icon-color-1': '#16a34a' }}
|
||||
/>
|
||||
</main>
|
||||
</StrictMode>,
|
||||
)
|
||||
2
integration/apps/react-webpack/src/sprite/.gitignore
vendored
Normal file
2
integration/apps/react-webpack/src/sprite/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
# @generated by @gromlab/svg-sprites. Do not edit.
|
||||
/.svg-sprite/
|
||||
1
integration/apps/react-webpack/src/sprite/index.ts
Normal file
1
integration/apps/react-webpack/src/sprite/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './.svg-sprite'
|
||||
@@ -0,0 +1,8 @@
|
||||
import { defineSpriteConfig } from '@gromlab/svg-sprites'
|
||||
|
||||
export default defineSpriteConfig({
|
||||
mode: 'react@webpack',
|
||||
name: 'icons',
|
||||
inputFiles: ['../../../../fixtures/icons/check.svg'],
|
||||
generatedNotice: false,
|
||||
})
|
||||
10
integration/apps/react-webpack/src/style.css
Normal file
10
integration/apps/react-webpack/src/style.css
Normal file
@@ -0,0 +1,10 @@
|
||||
:root {
|
||||
font-family: system-ui, sans-serif;
|
||||
color: #172033;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 40px;
|
||||
}
|
||||
Reference in New Issue
Block a user