Skip to content

Commit

Permalink
Merge pull request #6972 from Sage/FE-6790
Browse files Browse the repository at this point in the history
refactor: convert utils & validations from enzyme to RTL
  • Loading branch information
tomdavies73 authored Sep 25, 2024
2 parents 5a7f30a + b793902 commit c5580bb
Show file tree
Hide file tree
Showing 15 changed files with 686 additions and 696 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import browserCheck, { isSafari } from ".";

describe("browserTypeCheck", () => {
test('returns true when the "chrome" property is present in the browser object', () => {
const browser = { chrome: { foo: true }, sidebar: undefined };
const result = browserCheck(browser);
expect(result).toEqual(true);
});
test('returns true when the "sidebar" property is present in the browser object', () => {
const browser = { chrome: undefined, sidebar: { foo: true } };
const result = browserCheck(browser);
expect(result).toEqual(true);
});
test('returns true when the "chrome" and "sidebar" properties are present in the browser object', () => {
const browser = { chrome: { foo: true }, sidebar: { foo: true } };
const result = browserCheck(browser);
expect(result).toEqual(true);
});
test('returns false when the "chrome" and "sidebar" properties are not present in the browser object', () => {
const browser = {};
const result = browserCheck(browser);
expect(result).toEqual(false);
});
});

describe("isSafari", () => {
test('returns true when the vendor string contains "Apple"', () => {
const navigator = { vendor: "Apple" } as Navigator;
const result = isSafari(navigator);
expect(result).toEqual(true);
});
test('returns false when the vendor string does not contain "Apple"', () => {
const navigator = { vendor: "foo" } as Navigator;
const result = isSafari(navigator);
expect(result).toEqual(false);
});
});
291 changes: 0 additions & 291 deletions src/__internal__/utils/helpers/events/events.spec.ts

This file was deleted.

Loading

0 comments on commit c5580bb

Please sign in to comment.