Skip to content

Instantly share code, notes, and snippets.

@dman777
Created July 24, 2023 02:36
Show Gist options
  • Save dman777/afb9d59128da09cec4e368d9cc398a07 to your computer and use it in GitHub Desktop.
Save dman777/afb9d59128da09cec4e368d9cc398a07 to your computer and use it in GitHub Desktop.
import {
baseTest as it,
expect,
} from '../base-test.mjs';
import { injectOktaToken } from '../utilities.mjs';
import {
setExistingButNoStartValueMock,
setExistingGeneratorMock,
setGeneratorContextNotExist,
} from '../mock-data/patient-id-generator.mjs';
const {
describe,
beforeEach,
} = it;
describe.only('Patient ID Generator', () => {
describe('When there is no existing generator context', () => {
beforeEach(async({ page })=> {
//await setExistingButNoStartValueMock(page);
//await setExistingGeneratorMock(page);
await setGeneratorContextNotExist(page);
await injectOktaToken(page);
page.goto('/reconcile/configure/identifier?foobar=bar&headerName=FOO')
});
it('it should have a header with client id and name', async ({ page }) => {
const el = page.getByText('Configure patient identifier for FOO, bar', { exact: true });
await expect(el).toBeVisible();
});
it('should have readonly', async({ page }) => {
const textLookUps = [
'Starting patient ID number',
'Increment by',
'Append to start',
'Append to end',
'No',
'Identifier length'
];
for (const text of textLookUps) {
const el = page.getByText(text, { exact: true });
await expect(el).toBeVisible();
await expect(el).toBeDisabled();
}
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment