Skip to content

Commit

Permalink
Split no-flip tests snapshots into multiple files
Browse files Browse the repository at this point in the history
  • Loading branch information
elchininet committed Apr 11, 2024
1 parent d15b0f6 commit de662fb
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 47 deletions.
45 changes: 0 additions & 45 deletions tests/__snapshots__/noflip.test.ts.snap

This file was deleted.

22 changes: 22 additions & 0 deletions tests/__snapshots__/noflip/combined/no-flip.snapshot
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`[[Mode: combined]] Combined Tests: No Flip 1`] = `
".test1 {
color: #000;
font-size: 10px;
font-weight: bold;
}

.test2, .test3 {
height: 100%;
width: 100%;
}

.test4,
.test5 {
border: 1px solid #FFF;
font-family: Arial;
font-weight: bold;
text-align: center;
}"
`;
3 changes: 3 additions & 0 deletions tests/__snapshots__/noflip/diff/no-flip.snapshot
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`[[Mode: diff]] Combined Tests: No Flip 1`] = `""`;
22 changes: 22 additions & 0 deletions tests/__snapshots__/noflip/override/no-flip.snapshot
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`[[Mode: override]] Combined Tests: No Flip 1`] = `
".test1 {
color: #000;
font-size: 10px;
font-weight: bold;
}

.test2, .test3 {
height: 100%;
width: 100%;
}

.test4,
.test5 {
border: 1px solid #FFF;
font-family: Arial;
font-weight: bold;
text-align: center;
}"
`;
13 changes: 11 additions & 2 deletions tests/noflip.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import postcss from 'postcss';
import postcssRTLCSS from '../src';
import { PluginOptions, Mode } from '../src/@types';
import { readCSSFile, runTests } from './utils';
import {
readCSSFile,
runTests,
createSnapshotFileName
} from './utils';
import 'jest-specific-snapshot';

const BASE_NAME = 'noflip';

runTests({}, (pluginOptions: PluginOptions): void => {

Expand All @@ -17,7 +24,9 @@ runTests({}, (pluginOptions: PluginOptions): void => {
const output = pluginOptions.mode === Mode.combined
? postcss([postcssRTLCSS()]).process(input)
: postcss([postcssRTLCSS(pluginOptions)]).process(input);
expect(output.css).toMatchSnapshot();
expect(output.css).toMatchSpecificSnapshot(
createSnapshotFileName(BASE_NAME,'no-flip', pluginOptions.mode)
);
expect(output.warnings()).toHaveLength(0);
});

Expand Down

0 comments on commit de662fb

Please sign in to comment.