Skip to content

Commit

Permalink
wip scss transform
Browse files Browse the repository at this point in the history
  • Loading branch information
Niklas Kiefer committed Oct 13, 2023
1 parent 986083a commit 45341b8
Show file tree
Hide file tree
Showing 9 changed files with 1,372 additions and 3 deletions.
23 changes: 23 additions & 0 deletions e2e/carbon/withCarbonStyles.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Forms playground</title>
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,600;1,400&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono&display=swap" rel="stylesheet">
<style>
html, body, #container {
margin: 0;
padding: 0;
width: 100vw;
height: 100vh;
}
</style>
</head>
<body class="cds--g10">
<div id="container" role="main"></div>
<script type="module" src="withCarbonStyles.js"></script>
</body>
</html>
11 changes: 11 additions & 0 deletions e2e/carbon/withCarbonStyles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import '@bpmn-io/form-js/dist/assets/form-js.css';
import '@bpmn-io/form-js/dist/assets/form-js-editor.css';
import '@bpmn-io/form-js/dist/assets/form-js-playground.css';

import './theme.scss';

import '../../packages/form-js-carbon-styles/src/carbon-styles.scss';

import { renderSchema } from '../renderSchema';

renderSchema();
38 changes: 38 additions & 0 deletions e2e/visual/carbon-styles.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const { expect } = require('@playwright/test');

const { test } = require('../test-fixtures');

const schema = require('./fixtures/form.json');

test('carbon styles', async ({ page, makeAxeBuilder }) => {

// given
await page.route('/form', route => {

route.fulfill({
status: 200,
body: JSON.stringify({
data: {
schema,
component: 'viewer'
}
})
});
});

// when
await page.goto('/withCarbonStyles');

await page.waitForSelector('#container', {
state: 'visible'
});

// then
await expect(page).toHaveScreenshot();

// and then
const results = await makeAxeBuilder().analyze();

expect(results.violations).toHaveLength(0);
expect(results.passes.length).toBeGreaterThan(0);
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 45341b8

Please sign in to comment.