@madie/madie-design-system 1.2.45 → 1.2.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madie/madie-design-system",
3
- "version": "1.2.45",
3
+ "version": "1.2.47",
4
4
  "description": "Shared style guide across the Madie program.",
5
5
  "main": "dist/index.js",
6
6
  "homepage": "https://github.com/MeasureAuthoringTool/madie-design-system",
@@ -169,4 +169,30 @@ describe("TextField", () => {
169
169
  expect(textNode.value).toBe("newVal");
170
170
  });
171
171
  });
172
+
173
+ test("Max Length renders", async () => {
174
+ await act(async () => {
175
+ const { findByTestId, getByTestId, findByText } = render(
176
+ <TextField
177
+ placeholder="test Name"
178
+ required
179
+ label="test Name"
180
+ id="testName"
181
+ inputProps={{ "data-testid": "test-name-input" }}
182
+ data-testid="test-name-text-field"
183
+ size="small"
184
+ maxLength={10}
185
+ />
186
+ );
187
+ expect(
188
+ await findByTestId("test-name-text-field")
189
+ ).toBeInTheDocument();
190
+ const textNode = await getByTestId("test-name-input");
191
+ userEvent.type(textNode, "newVal");
192
+ Simulate.change(textNode);
193
+ expect(textNode.value).toBe("newVal");
194
+ const maxLength = await findByText("/10 Characters");
195
+ expect(maxLength).toBeInTheDocument();
196
+ });
197
+ });
172
198
  });