Skip to content

Commit

Permalink
add media-query test to custom util spec
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredh159 committed Nov 29, 2023
1 parent 193a037 commit ffde7e6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/__tests__/custom-utils.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { describe, test, expect } from '@jest/globals';
import { create, plugin } from '../';
import { TwConfig } from '../tw-config';

// @ts-ignore
import tailwindPlugin from 'tailwindcss/plugin';
import type { TwConfig } from '../tw-config';
import { create, plugin } from '../';

describe(`custom registered utilities`, () => {
test(`register custom utilities, using package plugin fn`, () => {
Expand All @@ -20,6 +19,10 @@ describe(`custom registered utilities`, () => {
const tw = create(config);
expect(tw`btn`).toEqual({ paddingTop: 33 });
expect(tw`custom`).toEqual({ marginTop: 4, color: `#fff` });
// works with media queries
expect(tw`md:btn`).toEqual({});
tw.setWindowDimensions({ width: 800, height: 800 });
expect(tw`md:btn`).toEqual({ paddingTop: 33 });
});

test(`supports leading dot for added utilities`, () => {
Expand Down

0 comments on commit ffde7e6

Please sign in to comment.