Skip to content

Commit

Permalink
test(styles): add test to ensure fluid mixins exist (#12838)
Browse files Browse the repository at this point in the history
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
tw15egan and kodiakhq[bot] authored Dec 16, 2022
1 parent 79a4feb commit 8a07b83
Show file tree
Hide file tree
Showing 10 changed files with 270 additions and 0 deletions.
27 changes: 27 additions & 0 deletions packages/styles/scss/components/__tests__/fluid-combo-box-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Copyright IBM Corp. 2022
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*
* @jest-environment node
*/

'use strict';

const { SassRenderer } = require('@carbon/test-utils/scss');

const { render } = SassRenderer.create(__dirname);

describe('scss/components/fluid-combo-box', () => {
test('Public API', async () => {
const { unwrap } = await render(`
@use 'sass:map';
@use 'sass:meta';
@use '../fluid-combo-box';
$_: get('mixin', meta.mixin-exists('fluid-combo-box', 'fluid-combo-box'));
`);
expect(unwrap('mixin')).toBe(true);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Copyright IBM Corp. 2022
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*
* @jest-environment node
*/

'use strict';

const { SassRenderer } = require('@carbon/test-utils/scss');

const { render } = SassRenderer.create(__dirname);

describe('scss/components/fluid-date-picker', () => {
test('Public API', async () => {
const { unwrap } = await render(`
@use 'sass:map';
@use 'sass:meta';
@use '../fluid-date-picker';
$_: get('mixin', meta.mixin-exists('fluid-date-picker', 'fluid-date-picker'));
`);
expect(unwrap('mixin')).toBe(true);
});
});
27 changes: 27 additions & 0 deletions packages/styles/scss/components/__tests__/fluid-dropdown-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Copyright IBM Corp. 2022
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*
* @jest-environment node
*/

'use strict';

const { SassRenderer } = require('@carbon/test-utils/scss');

const { render } = SassRenderer.create(__dirname);

describe('scss/components/fluid-dropdown', () => {
test('Public API', async () => {
const { unwrap } = await render(`
@use 'sass:map';
@use 'sass:meta';
@use '../fluid-dropdown';
$_: get('mixin', meta.mixin-exists('fluid-dropdown', 'fluid-dropdown'));
`);
expect(unwrap('mixin')).toBe(true);
});
});
27 changes: 27 additions & 0 deletions packages/styles/scss/components/__tests__/fluid-list-box-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Copyright IBM Corp. 2022
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*
* @jest-environment node
*/

'use strict';

const { SassRenderer } = require('@carbon/test-utils/scss');

const { render } = SassRenderer.create(__dirname);

describe('scss/components/fluid-list-box', () => {
test('Public API', async () => {
const { unwrap } = await render(`
@use 'sass:map';
@use 'sass:meta';
@use '../fluid-list-box';
$_: get('mixin', meta.mixin-exists('fluid-list-box', 'fluid-list-box'));
`);
expect(unwrap('mixin')).toBe(true);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Copyright IBM Corp. 2022
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*
* @jest-environment node
*/

'use strict';

const { SassRenderer } = require('@carbon/test-utils/scss');

const { render } = SassRenderer.create(__dirname);

describe('scss/components/fluid-multiselect', () => {
test('Public API', async () => {
const { unwrap } = await render(`
@use 'sass:map';
@use 'sass:meta';
@use '../fluid-multiselect';
$_: get('mixin', meta.mixin-exists('fluid-multiselect', 'fluid-multiselect'));
`);
expect(unwrap('mixin')).toBe(true);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Copyright IBM Corp. 2022
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*
* @jest-environment node
*/

'use strict';

const { SassRenderer } = require('@carbon/test-utils/scss');

const { render } = SassRenderer.create(__dirname);

describe('scss/components/fluid-number-input', () => {
test('Public API', async () => {
const { unwrap } = await render(`
@use 'sass:map';
@use 'sass:meta';
@use '../fluid-number-input';
$_: get('mixin', meta.mixin-exists('fluid-number-input', 'fluid-number-input'));
`);
expect(unwrap('mixin')).toBe(true);
});
});
27 changes: 27 additions & 0 deletions packages/styles/scss/components/__tests__/fluid-select-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Copyright IBM Corp. 2022
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*
* @jest-environment node
*/

'use strict';

const { SassRenderer } = require('@carbon/test-utils/scss');

const { render } = SassRenderer.create(__dirname);

describe('scss/components/fluid-select', () => {
test('Public API', async () => {
const { unwrap } = await render(`
@use 'sass:map';
@use 'sass:meta';
@use '../fluid-select';
$_: get('mixin', meta.mixin-exists('fluid-select', 'fluid-select'));
`);
expect(unwrap('mixin')).toBe(true);
});
});
27 changes: 27 additions & 0 deletions packages/styles/scss/components/__tests__/fluid-text-area-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Copyright IBM Corp. 2022
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*
* @jest-environment node
*/

'use strict';

const { SassRenderer } = require('@carbon/test-utils/scss');

const { render } = SassRenderer.create(__dirname);

describe('scss/components/fluid-text-area', () => {
test('Public API', async () => {
const { unwrap } = await render(`
@use 'sass:map';
@use 'sass:meta';
@use '../fluid-text-area';
$_: get('mixin', meta.mixin-exists('fluid-text-area', 'fluid-text-area'));
`);
expect(unwrap('mixin')).toBe(true);
});
});
27 changes: 27 additions & 0 deletions packages/styles/scss/components/__tests__/fluid-text-input-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Copyright IBM Corp. 2022
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*
* @jest-environment node
*/

'use strict';

const { SassRenderer } = require('@carbon/test-utils/scss');

const { render } = SassRenderer.create(__dirname);

describe('scss/components/fluid-text-input', () => {
test('Public API', async () => {
const { unwrap } = await render(`
@use 'sass:map';
@use 'sass:meta';
@use '../fluid-text-input';
$_: get('mixin', meta.mixin-exists('fluid-text-input', 'fluid-text-input'));
`);
expect(unwrap('mixin')).toBe(true);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Copyright IBM Corp. 2022
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*
* @jest-environment node
*/

'use strict';

const { SassRenderer } = require('@carbon/test-utils/scss');

const { render } = SassRenderer.create(__dirname);

describe('scss/components/fluid-time-picker', () => {
test('Public API', async () => {
const { unwrap } = await render(`
@use 'sass:map';
@use 'sass:meta';
@use '../fluid-time-picker';
$_: get('mixin', meta.mixin-exists('fluid-time-picker', 'fluid-time-picker'));
`);
expect(unwrap('mixin')).toBe(true);
});
});

0 comments on commit 8a07b83

Please sign in to comment.