Skip to content

Commit d6604c4

Browse files
committed
Test cleanup
1 parent 4323c9e commit d6604c4

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

e2e/tests/erStatus.spec.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ const { test, expect } = require('@playwright/test');
22

33
test.describe('ER status', () => {
44
test.describe.configure({ mode: 'serial' });
5-
let erBeds = 0;
6-
let behaviorBeds = 0;
5+
let numberErBeds = 0;
6+
let numberBehaviorBeds = 0;
77

88
test('Update ER status', async ({ context }) => {
99
const appPage = await context.newPage();
@@ -19,18 +19,18 @@ test.describe('ER status', () => {
1919
await expect(appPage.getByText(/er conditions/i)).toBeVisible();
2020
await appPage.getByRole('button', { name: /update hospital/i }).click();
2121
const erBedsRow = appPage.getByTestId('counter_openEdBedCount');
22-
erBeds = parseInt(await erBedsRow.getByRole('textbox').inputValue(), 10);
22+
numberErBeds = parseInt(await erBedsRow.getByRole('textbox').inputValue(), 10);
2323
for (let i = 0; i < 5; i++) {
2424
await erBedsRow.getByRole('button', { name: '+' }).click();
25-
erBeds += 1;
25+
numberErBeds++;
2626
}
2727

2828
const behaviorNode = appPage.getByLabel(/behavioral beds/i);
2929
const behaviorBedsRow = appPage.getByTestId('counter_openPsychBedCount');
30-
behaviorBeds = parseInt(await behaviorNode.inputValue(), 10);
30+
numberBehaviorBeds = parseInt(await behaviorNode.inputValue(), 10);
3131
for (let i = 0; i < 8; i++) {
3232
await behaviorBedsRow.getByRole('button', { name: '+' }).click();
33-
behaviorBeds += 1;
33+
numberBehaviorBeds++;
3434
}
3535
await appPage.locator('#additionalNotes').fill('scanner broke');
3636
await appPage.getByRole('button', { name: /confirm/i }).click();
@@ -46,8 +46,8 @@ test.describe('ER status', () => {
4646
await expect(appPage).toHaveURL('/ems');
4747
await appPage.getByRole('button', { name: /hospital info/i }).click();
4848
const ucsfRow = appPage.locator('.hospitalstatusrow_container').filter({ hasText: /ucsf parnassus/i });
49-
await expect(ucsfRow.locator('.hospitalstatusrow__data').filter({ hasText: `${erBeds}` })).toBeVisible();
50-
await expect(ucsfRow.locator('.hospitalstatusrow__data').filter({ hasText: `${behaviorBeds}` })).toBeVisible();
49+
await expect(ucsfRow.locator('.hospitalstatusrow__data').filter({ hasText: `${numberErBeds}` })).toBeVisible();
50+
await expect(ucsfRow.locator('.hospitalstatusrow__data').filter({ hasText: `${numberBehaviorBeds}` })).toBeVisible();
5151
await expect(ucsfRow.getByText('scanner broke')).toBeVisible();
5252
await context.close();
5353
});
@@ -66,19 +66,19 @@ test.describe('ER status', () => {
6666
await expect(appPage.getByText(/er conditions/i)).toBeVisible();
6767
await appPage.getByRole('button', { name: /update hospital/i }).click();
6868
const erBedsRow = appPage.getByTestId('counter_openEdBedCount');
69-
erBeds = parseInt(await erBedsRow.getByRole('textbox').inputValue(), 10);
70-
while (erBeds >= 0) {
69+
numberErBeds = parseInt(await erBedsRow.getByRole('textbox').inputValue(), 10);
70+
while (numberErBeds >= 0) {
7171
await erBedsRow.getByTestId('decrement').click();
72-
erBeds--;
72+
numberErBeds--;
7373
}
7474
const erBedValue = await appPage.getByRole('textbox', { name: /er beds/i }).inputValue();
7575
expect(erBedValue).toBe('0');
7676

7777
const behaviorBedsRow = appPage.getByTestId('counter_openPsychBedCount');
78-
behaviorBeds = parseInt(await behaviorBedsRow.getByRole('textbox').inputValue(), 10);
79-
while (behaviorBeds >= 0) {
78+
numberBehaviorBeds = parseInt(await behaviorBedsRow.getByRole('textbox').inputValue(), 10);
79+
while (numberBehaviorBeds >= 0) {
8080
await behaviorBedsRow.getByTestId('decrement').click();
81-
behaviorBeds--;
81+
numberBehaviorBeds--;
8282
}
8383
expect(await appPage.getByRole('textbox', { name: /behavioral beds/i }).inputValue()).toBe('0');
8484
await appPage.locator('#additionalNotes').fill('');

0 commit comments

Comments
 (0)