Skip to content

Commit 10ee23e

Browse files
committed
rearange test
1 parent 8473195 commit 10ee23e

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

packages/compass-global-writes/src/components/example-commands-markup.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const codeBlockContainerStyles = css({
1717
gap: spacing[100],
1818
});
1919

20-
interface ExampleCommandsMarkupProps {
20+
export interface ExampleCommandsMarkupProps {
2121
shardKey: ShardKey;
2222
namespace: string;
2323
showMetaData?: boolean;

packages/compass-global-writes/src/components/states/incomplete-sharding-setup.spec.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,11 @@ describe('IncompleteShardingSetup', function () {
112112
expect(list).to.be.visible;
113113
expect(list.textContent).to.contain(`"location", "secondary"`);
114114
});
115+
116+
it('Includes code examples', async function () {
117+
await renderWithProps();
118+
119+
const example = await screen.findByText(/Example commands/);
120+
expect(example).to.be.visible;
121+
});
115122
});

packages/compass-global-writes/src/components/states/shard-key-correct.spec.tsx

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -92,23 +92,10 @@ describe('ShardKeyCorrect', function () {
9292
expect(list.textContent).to.contain(`"location", "secondary"`);
9393
});
9494

95-
it('Contains sample codes', async function () {
95+
it('Includes code examples', async function () {
9696
await renderWithProps();
9797

98-
const findingDocumentsSample = await screen.findByTestId(
99-
'sample-finding-documents'
100-
);
101-
expect(findingDocumentsSample).to.be.visible;
102-
expect(findingDocumentsSample.textContent).to.contain(
103-
`use db1db["coll1"].find({"location": "US-NY", "secondary": "<id_value>"})`
104-
);
105-
106-
const insertingDocumentsSample = await screen.findByTestId(
107-
'sample-inserting-documents'
108-
);
109-
expect(insertingDocumentsSample).to.be.visible;
110-
expect(insertingDocumentsSample.textContent).to.contain(
111-
`use db1db["coll1"].insertOne({"location": "US-NY", "secondary": "<id_value>",...<other fields>})`
112-
);
98+
const example = await screen.findByText(/Example commands/);
99+
expect(example).to.be.visible;
113100
});
114101
});

0 commit comments

Comments
 (0)