mirror of
https://github.com/minio/minio.git
synced 2025-11-23 19:17:43 -05:00
revert browser newux changes (#5714)
This commit is contained in:
@@ -21,10 +21,9 @@ const Alert = ({ show, type, message, onDismiss }) => (
|
||||
<AlertComponent
|
||||
className={"alert animated " + (show ? "fadeInDown" : "fadeOutUp")}
|
||||
bsStyle={type}
|
||||
closeLabel=""
|
||||
onDismiss={onDismiss}
|
||||
>
|
||||
<i className="close close--alt" onClick={onDismiss} />
|
||||
{message}
|
||||
<div className="text-center">{message}</div>
|
||||
</AlertComponent>
|
||||
)
|
||||
|
||||
|
||||
@@ -28,9 +28,7 @@ describe("Alert", () => {
|
||||
const wrapper = mount(
|
||||
<Alert show={true} type="danger" message="test" onDismiss={onDismiss} />
|
||||
)
|
||||
wrapper.find("i").simulate("click", {
|
||||
preventDefault: jest.fn()
|
||||
})
|
||||
wrapper.find("button").simulate("click", { preventDefault: jest.fn() })
|
||||
expect(onDismiss).toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
|
||||
@@ -29,19 +29,10 @@ describe("Alert actions", () => {
|
||||
const expectedActions = [
|
||||
{
|
||||
type: "alert/SET",
|
||||
alert: {
|
||||
id: 0,
|
||||
message: "Test alert",
|
||||
type: "danger"
|
||||
}
|
||||
alert: { id: 0, message: "Test alert", type: "danger" }
|
||||
}
|
||||
]
|
||||
store.dispatch(
|
||||
actionsAlert.set({
|
||||
message: "Test alert",
|
||||
type: "danger"
|
||||
})
|
||||
)
|
||||
store.dispatch(actionsAlert.set({ message: "Test alert", type: "danger" }))
|
||||
const actions = store.getActions()
|
||||
expect(actions).toEqual(expectedActions)
|
||||
})
|
||||
@@ -51,23 +42,14 @@ describe("Alert actions", () => {
|
||||
const expectedActions = [
|
||||
{
|
||||
type: "alert/SET",
|
||||
alert: {
|
||||
id: 1,
|
||||
message: "Test alert"
|
||||
}
|
||||
alert: { id: 1, message: "Test alert" }
|
||||
},
|
||||
{
|
||||
type: "alert/CLEAR",
|
||||
alert: {
|
||||
id: 1
|
||||
}
|
||||
alert: { id: 1 }
|
||||
}
|
||||
]
|
||||
store.dispatch(
|
||||
actionsAlert.set({
|
||||
message: "Test alert"
|
||||
})
|
||||
)
|
||||
store.dispatch(actionsAlert.set({ message: "Test alert" }))
|
||||
jest.runAllTimers()
|
||||
const actions = store.getActions()
|
||||
expect(actions).toEqual(expectedActions)
|
||||
|
||||
@@ -29,11 +29,7 @@ describe("alert reducer", () => {
|
||||
expect(
|
||||
reducer(undefined, {
|
||||
type: actionsAlert.SET,
|
||||
alert: {
|
||||
id: 1,
|
||||
type: "danger",
|
||||
message: "Test message"
|
||||
}
|
||||
alert: { id: 1, type: "danger", message: "Test message" }
|
||||
})
|
||||
).toEqual({
|
||||
show: true,
|
||||
@@ -46,11 +42,7 @@ describe("alert reducer", () => {
|
||||
it("should clear alert if id not passed", () => {
|
||||
expect(
|
||||
reducer(
|
||||
{
|
||||
show: true,
|
||||
type: "danger",
|
||||
message: "Test message"
|
||||
},
|
||||
{ show: true, type: "danger", message: "Test message" },
|
||||
{
|
||||
type: actionsAlert.CLEAR
|
||||
}
|
||||
@@ -64,17 +56,10 @@ describe("alert reducer", () => {
|
||||
it("should clear alert if id is matching", () => {
|
||||
expect(
|
||||
reducer(
|
||||
{
|
||||
show: true,
|
||||
id: 1,
|
||||
type: "danger",
|
||||
message: "Test message"
|
||||
},
|
||||
{ show: true, id: 1, type: "danger", message: "Test message" },
|
||||
{
|
||||
type: actionsAlert.CLEAR,
|
||||
alert: {
|
||||
id: 1
|
||||
}
|
||||
alert: { id: 1 }
|
||||
}
|
||||
)
|
||||
).toEqual({
|
||||
@@ -86,17 +71,10 @@ describe("alert reducer", () => {
|
||||
it("should not clear alert if id is not matching", () => {
|
||||
expect(
|
||||
reducer(
|
||||
{
|
||||
show: true,
|
||||
id: 1,
|
||||
type: "danger",
|
||||
message: "Test message"
|
||||
},
|
||||
{ show: true, id: 1, type: "danger", message: "Test message" },
|
||||
{
|
||||
type: actionsAlert.CLEAR,
|
||||
alert: {
|
||||
id: 2
|
||||
}
|
||||
alert: { id: 2 }
|
||||
}
|
||||
)
|
||||
).toEqual({
|
||||
|
||||
@@ -42,7 +42,5 @@ export const set = alert => {
|
||||
}
|
||||
|
||||
export const clear = () => {
|
||||
return {
|
||||
type: CLEAR
|
||||
}
|
||||
return { type: CLEAR }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user