Skip to content

Commit 1a27019

Browse files
[pre-commit.ci lite] apply automatic fixes
1 parent c7dcc6a commit 1a27019

File tree

1 file changed

+30
-46
lines changed
  • contentcuration/contentcuration/frontend/accounts/pages/__tests__

1 file changed

+30
-46
lines changed

contentcuration/contentcuration/frontend/accounts/pages/__tests__/create.spec.js

Lines changed: 30 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ describe('Create account page', () => {
3333
test('smoke test: renders the create account page', async () => {
3434
await renderComponent();
3535

36-
expect(
37-
await screen.findByRole('heading', { name: /create an account/i })
38-
).toBeInTheDocument();
36+
expect(await screen.findByRole('heading', { name: /create an account/i })).toBeInTheDocument();
3937
});
4038

4139
test('shows validation state when submitting empty form', async () => {
@@ -66,12 +64,8 @@ describe('Create account page', () => {
6664
test('allows user to check checkboxes', async () => {
6765
await renderComponent();
6866

69-
const contentSourcesCheckbox = screen.getByLabelText(
70-
/tagging content sources/i
71-
);
72-
const tosCheckbox = screen.getByLabelText(
73-
/i have read and agree to terms of service/i
74-
);
67+
const contentSourcesCheckbox = screen.getByLabelText(/tagging content sources/i);
68+
const tosCheckbox = screen.getByLabelText(/i have read and agree to terms of service/i);
7569

7670
await userEvent.click(contentSourcesCheckbox);
7771
await userEvent.click(tosCheckbox);
@@ -91,26 +85,24 @@ describe('Create account page', () => {
9185
expect(emailInput).toHaveValue('[email protected]');
9286
});
9387
});
94-
// NOTE:
95-
// Full form submission tests are intentionally skipped here.
96-
//
97-
// This page still relies on Vuetify components (v-select / v-autocomplete)
98-
// for required fields such as "locations" and "source".
99-
// These components do not reliably update their v-model state when interacted
100-
// with via Vue Testing Library’s userEvent APIs, which prevents a fully
101-
// user-centric submission flow from being exercised.
102-
//
103-
// The previous Vue Test Utils tests worked around this by directly mutating
104-
// component data (setData), which is intentionally avoided when using
105-
// Testing Library.
106-
//
107-
// These tests will be re-enabled once this page is migrated to the
108-
// Kolibri Design System as part of the Vuetify removal effort .
88+
// NOTE:
89+
// Full form submission tests are intentionally skipped here.
90+
//
91+
// This page still relies on Vuetify components (v-select / v-autocomplete)
92+
// for required fields such as "locations" and "source".
93+
// These components do not reliably update their v-model state when interacted
94+
// with via Vue Testing Library’s userEvent APIs, which prevents a fully
95+
// user-centric submission flow from being exercised.
96+
//
97+
// The previous Vue Test Utils tests worked around this by directly mutating
98+
// component data (setData), which is intentionally avoided when using
99+
// Testing Library.
100+
//
101+
// These tests will be re-enabled once this page is migrated to the
102+
// Kolibri Design System as part of the Vuetify removal effort .
109103

110104
test.skip('creates an account when the user submits valid information', async () => {
111-
const registerSpy = jest
112-
.spyOn(Create.methods, 'register')
113-
.mockResolvedValue();
105+
const registerSpy = jest.spyOn(Create.methods, 'register').mockResolvedValue();
114106

115107
await renderComponent();
116108

@@ -120,18 +112,14 @@ describe('Create account page', () => {
120112
await userEvent.type(screen.getByLabelText(/^password$/i), 'tester123');
121113
await userEvent.type(screen.getByLabelText(/confirm password/i), 'tester123');
122114

123-
await userEvent.click(
124-
screen.getByLabelText(/tagging content sources/i)
125-
);
115+
await userEvent.click(screen.getByLabelText(/tagging content sources/i));
126116

127-
await userEvent.click(
128-
screen.getByLabelText(/i have read and agree to terms of service/i)
129-
);
117+
await userEvent.click(screen.getByLabelText(/i have read and agree to terms of service/i));
130118

131119
const finishButton = screen.getByRole('button', { name: /finish/i });
132120

133121
await waitFor(() => {
134-
expect(finishButton).not.toBeDisabled();
122+
expect(finishButton).toBeEnabled();
135123
});
136124

137125
await userEvent.click(finishButton);
@@ -140,12 +128,12 @@ describe('Create account page', () => {
140128
expect(registerSpy).toHaveBeenCalled();
141129
});
142130
});
143-
// NOTE:
144-
// Offline submission depends on the same required Vuetify select fields
145-
// as the successful submission flow.
146-
// Since those fields cannot be reliably exercised via userEvent,
147-
// this scenario cannot currently reach the submission state.
148-
// This test will be re-enabled once Vuetify is removed .
131+
// NOTE:
132+
// Offline submission depends on the same required Vuetify select fields
133+
// as the successful submission flow.
134+
// Since those fields cannot be reliably exercised via userEvent,
135+
// this scenario cannot currently reach the submission state.
136+
// This test will be re-enabled once Vuetify is removed .
149137
test.skip('shows an offline error when the user is offline', async () => {
150138
await renderComponent({ offline: true });
151139

@@ -155,13 +143,9 @@ describe('Create account page', () => {
155143
await userEvent.type(screen.getByLabelText(/^password$/i), 'tester123');
156144
await userEvent.type(screen.getByLabelText(/confirm password/i), 'tester123');
157145

158-
await userEvent.click(
159-
screen.getByLabelText(/tagging content sources/i)
160-
);
146+
await userEvent.click(screen.getByLabelText(/tagging content sources/i));
161147

162-
await userEvent.click(
163-
screen.getByLabelText(/i have read and agree to terms of service/i)
164-
);
148+
await userEvent.click(screen.getByLabelText(/i have read and agree to terms of service/i));
165149

166150
const finishButton = screen.getByRole('button', { name: /finish/i });
167151
await userEvent.click(finishButton);

0 commit comments

Comments
 (0)