Commit e4e05a45 authored by Paul Slaughter's avatar Paul Slaughter

Nest sibling describe under top-level describe

- https://gitlab.com/gitlab-org/gitlab/-/merge_requests/67353#note_643586747
parent e9ad663e
......@@ -104,30 +104,30 @@ describe('helpers/set_window_location_helper', () => {
);
});
});
});
// This set of tests relies on Jest executing tests in source order, which is
// at the time of writing the only order they will execute, by design.
// See https://github.com/facebook/jest/issues/4386 for more details.
describe('window.location resetting by global beforeEach', () => {
const overridden = 'https://gdk.test:1234/';
const initial = `${TEST_HOST}/`;
it('works before an override', () => {
expect(window.location.href).toBe(initial);
});
// This set of tests relies on Jest executing tests in source order, which is
// at the time of writing the only order they will execute, by design.
// See https://github.com/facebook/jest/issues/4386 for more details.
describe('window.location resetting by global beforeEach', () => {
const overridden = 'https://gdk.test:1234/';
const initial = `${TEST_HOST}/`;
describe('overriding', () => {
beforeEach(() => {
setWindowLocation(overridden);
it('works before an override', () => {
expect(window.location.href).toBe(initial);
});
it('works', () => {
expect(window.location.href).toBe(overridden);
describe('overriding', () => {
beforeEach(() => {
setWindowLocation(overridden);
});
it('works', () => {
expect(window.location.href).toBe(overridden);
});
});
});
it('works after an override', () => {
expect(window.location.href).toBe(initial);
it('works after an override', () => {
expect(window.location.href).toBe(initial);
});
});
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment