Skip to content

Commit

Permalink
fix up unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bnussman committed Jan 17, 2025
1 parent 1f806f0 commit 479d26c
Showing 1 changed file with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import React from 'react';

import { renderWithThemeAndHookFormContext } from 'src/utilities/testHelpers';
import { renderWithTheme } from 'src/utilities/testHelpers';

import { StackScriptCreate } from './StackScriptCreate';

describe('StackScriptCreate', () => {
it('should render header, inputs, and buttons', () => {
const { getByLabelText, getByText } = renderWithThemeAndHookFormContext({
component: <StackScriptCreate />,
});

expect(getByText('Create')).toBeVisible();
const { getByLabelText, getByText } = renderWithTheme(
<StackScriptCreate />
);

expect(getByLabelText('StackScript Label (required)')).toBeVisible();
expect(getByLabelText('Description')).toBeVisible();
Expand All @@ -21,9 +19,5 @@ describe('StackScriptCreate', () => {
const createButton = getByText('Create StackScript').closest('button');
expect(createButton).toBeVisible();
expect(createButton).toBeEnabled();

const resetButton = getByText('Reset').closest('button');
expect(resetButton).toBeVisible();
expect(resetButton).toBeDisabled();
});
});

0 comments on commit 479d26c

Please sign in to comment.