Skip to content

Commit

Permalink
test: update tests with dataId check
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed May 9, 2021
1 parent 1867ac2 commit 44047f7
Show file tree
Hide file tree
Showing 39 changed files with 65 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('VariantButton', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
13 changes: 13 additions & 0 deletions examples/stories/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"module": "esnext",
"outDir": "dist",
"rootDir": "src",
"declaration": true,
"types": ["node", "jest"],
"typeRoots": ["../../node_modules/@types", "node_modules/@types"]
},
"include": ["src/**/*", "src/typings.d.ts"],
"exclude": ["node_modules/**"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ renderedExamples.forEach(({ name, rendered {{? it.data }}, dataId, values{{?}}})
{{=it.allytest}}
{{? it.data }}
}
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ renderedExamples.forEach(({ name, rendered{{? it.data }}, dataId, values{{?}}})
{{=it.allytest}}
{{? it.data }}
}
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ renderedExamples.forEach(({ name, rendered{{? it.data }}, dataId, values{{?}}})
{{=it.allytest}}
{{? it.data }}
}
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
12 changes: 6 additions & 6 deletions plugins/cc-cli/test/__snapshots__/cli-document-data.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('Popover', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down Expand Up @@ -170,7 +170,7 @@ describe('VariantButton', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down Expand Up @@ -230,7 +230,7 @@ describe('VariantButton', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down Expand Up @@ -294,7 +294,7 @@ describe('VariantButton', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down Expand Up @@ -362,7 +362,7 @@ describe('VariantButton', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down Expand Up @@ -426,7 +426,7 @@ describe('VariantButton', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('VariantButton', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('VariantButton', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('VariantButton', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('VariantButton', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('VariantButton', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('VariantButton', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('VariantButton', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('VariantButton', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('VariantButton', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
2 changes: 1 addition & 1 deletion ui/app/src/AppError/AppError.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('AppError', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
2 changes: 1 addition & 1 deletion ui/blocks/src/ComponentCommits/ComponentCommits.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('ComponentCommits', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
2 changes: 1 addition & 1 deletion ui/blocks/src/TestsCoverage/TestsCoverage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('TestsCoverage', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
2 changes: 1 addition & 1 deletion ui/blocks/src/TestsResults/TestsResults.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('TestsResults', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
2 changes: 1 addition & 1 deletion ui/components/src/ActionBar/ActionBar.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('ActionBar', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
2 changes: 1 addition & 1 deletion ui/components/src/BlockContainer/BlockContainer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('BlockContainer', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
2 changes: 1 addition & 1 deletion ui/components/src/Collapsible/Collapsible.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('Collapsible', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
2 changes: 1 addition & 1 deletion ui/components/src/Donut/Donut.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('Donut', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
2 changes: 1 addition & 1 deletion ui/components/src/ExternalLink/ExternalLink.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('ExternalLink', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
2 changes: 1 addition & 1 deletion ui/components/src/GithubAvatar/GithubAvatar.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('GithubAvatar', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
2 changes: 1 addition & 1 deletion ui/components/src/InfoTip/InfoTip.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('InfoTip', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
2 changes: 1 addition & 1 deletion ui/components/src/LinkHeading/LinkHeading.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('LinkHeading', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ exports[`LinkHeading overview 0 snapshot 1`] = `
class="emotion-1"
>
<a
aria-label="navigate to navigate to angelica-howell section"
aria-label="navigate to angelica-howell section"
class="emotion-2"
data-id="angelica-howell"
data-level="1"
data-title="navigate to angelica-howell"
data-title="angelica-howell"
href="http://localhost/#angelica-howell"
>
<svg
Expand Down Expand Up @@ -188,11 +188,11 @@ exports[`LinkHeading overview 1 snapshot 1`] = `
class="emotion-1"
>
<a
aria-label="navigate to navigate to mrs--rosalyn-moen section"
aria-label="navigate to mrs--rosalyn-moen section"
class="emotion-2"
data-id="mrs--rosalyn-moen"
data-level="6"
data-title="navigate to mrs--rosalyn-moen"
data-title="mrs--rosalyn-moen"
href="http://localhost/#mrs--rosalyn-moen"
>
<svg
Expand Down Expand Up @@ -298,11 +298,11 @@ exports[`LinkHeading overview 2 snapshot 1`] = `
class="emotion-1"
>
<a
aria-label="navigate to navigate to stuart-rutherford section"
aria-label="navigate to stuart-rutherford section"
class="emotion-2"
data-id="stuart-rutherford"
data-level="1"
data-title="navigate to stuart-rutherford"
data-title="stuart-rutherford"
href="http://localhost/#stuart-rutherford"
>
<svg
Expand Down Expand Up @@ -412,11 +412,11 @@ exports[`LinkHeading overview 3 snapshot 1`] = `
class="emotion-1"
>
<a
aria-label="navigate to navigate to miss-litzy-bergnaum section"
aria-label="navigate to miss-litzy-bergnaum section"
class="emotion-2"
data-id="miss-litzy-bergnaum"
data-level="2"
data-title="navigate to miss-litzy-bergnaum"
data-title="miss-litzy-bergnaum"
href="http://localhost/#miss-litzy-bergnaum"
>
<svg
Expand Down Expand Up @@ -524,11 +524,11 @@ exports[`LinkHeading overview 4 snapshot 1`] = `
class="emotion-1"
>
<a
aria-label="navigate to navigate to dr--dariana-murray section"
aria-label="navigate to dr--dariana-murray section"
class="emotion-2"
data-id="dr--dariana-murray"
data-level="1"
data-title="navigate to dr--dariana-murray"
data-title="dr--dariana-murray"
href="http://localhost/#dr--dariana-murray"
>
<svg
Expand Down
2 changes: 1 addition & 1 deletion ui/components/src/Popover/Popover.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('Popover', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('ProgressIndicator', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
2 changes: 1 addition & 1 deletion ui/components/src/Shield/Shield.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('Shield', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
2 changes: 1 addition & 1 deletion ui/components/src/Sidebar/Sidebar.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('Sidebar', () => {
expect(axeResults).toHaveNoAxeViolations();
});
};
if (values) {
if (dataId && values) {
describe(dataId, runTests);
} else {
runTests();
Expand Down
Loading

0 comments on commit 44047f7

Please sign in to comment.