mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 07:43:35 +00:00
[CL-18] toast component and service (#6490)
Update toast styles and new service to CL.
This commit is contained in:
16
libs/components/src/toast/toast.spec.ts
Normal file
16
libs/components/src/toast/toast.spec.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { calculateToastTimeout } from "./utils";
|
||||
|
||||
describe("Toast default timer", () => {
|
||||
it("should have a minimum of 5000ms", () => {
|
||||
expect(calculateToastTimeout("")).toBe(5000);
|
||||
expect(calculateToastTimeout([""])).toBe(5000);
|
||||
expect(calculateToastTimeout(" ")).toBe(5000);
|
||||
});
|
||||
|
||||
it("should return an extra second for each 120 words", () => {
|
||||
expect(calculateToastTimeout("foo ".repeat(119))).toBe(5000);
|
||||
expect(calculateToastTimeout("foo ".repeat(120))).toBe(6000);
|
||||
expect(calculateToastTimeout("foo ".repeat(240))).toBe(7000);
|
||||
expect(calculateToastTimeout(["foo ".repeat(120), " \n foo ".repeat(120)])).toBe(7000);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user