-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #355 from ajit3190/develop_react_upgrade
Merging back changes from ajit3180 develop_react_upgrade branch
- Loading branch information
Showing
36 changed files
with
404 additions
and
482 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 3 additions & 4 deletions
7
...onents/button-text/component.unit.test.js → .../components/button-text/component.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
import { setupMountedComponent } from "../../test"; | ||
import { mountedComponent, screen } from "test-utils"; | ||
|
||
import ButtonText from "./component"; | ||
|
||
describe("<ButtonText />", () => { | ||
let component; | ||
const props = { | ||
text: "Test Title" | ||
}; | ||
|
||
beforeEach(() => { | ||
({ component } = setupMountedComponent(ButtonText, props, {})); | ||
mountedComponent(<ButtonText {...props} />); | ||
}); | ||
|
||
it("should render text", () => { | ||
expect(component.text()).to.be.equals("Test Title"); | ||
expect(screen.getByText("Test Title")).toBeInTheDocument(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
app/javascript/components/change-logs/components/change-log-item/component.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { mountedComponent, screen } from "test-utils"; | ||
|
||
import ChangeLogItem from "."; | ||
|
||
describe("ChangeLogItems - Component", () => { | ||
const title = "Changed Nationality from Canada to Australia"; | ||
const user = "primero"; | ||
const props = { | ||
item: { | ||
title, | ||
user, | ||
date: "2020-08-11T10:27:33Z", | ||
change: { from: "Canada", to: "Australia", name: "Field" } | ||
} | ||
}; | ||
|
||
beforeEach(() => { | ||
mountedComponent(<ChangeLogItem {...props} />); | ||
}); | ||
it("renders ChangeLogItem", () => { | ||
const element = screen.getByText("Changed Nationality from Canada to Australia"); | ||
|
||
expect(element).toBeInTheDocument(); | ||
}); | ||
|
||
it("renders the change", () => { | ||
const element = screen.getByText('change_logs.from "Canada" change_logs.to "Australia"'); | ||
|
||
expect(element).toBeInTheDocument(); | ||
}); | ||
}); |
66 changes: 0 additions & 66 deletions
66
app/javascript/components/change-logs/components/change-log-item/component.unit.test.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
app/javascript/components/contact-information/container.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { mountedComponent, screen } from "test-utils"; | ||
|
||
import Support from "./container"; | ||
import { ContactInformationRecord } from "./records"; | ||
|
||
describe("<Support />", () => { | ||
beforeEach(() => { | ||
mountedComponent(<Support />, { | ||
records: { | ||
Support: { | ||
data: ContactInformationRecord({ | ||
name: "Simon Nehme", | ||
organization: "UNICEF", | ||
position: "Child Protection Officer - CPIMS Administrator", | ||
phone: "+961 70 673 187", | ||
email: "[email protected]", | ||
location: "United Nations Children’s Fund Lebanon", | ||
support_forum: "https://google.com", | ||
other_information: "", | ||
primeroVersion: "1.3.15" | ||
}) | ||
} | ||
} | ||
}); | ||
}); | ||
|
||
it("renders the Support", () => { | ||
expect(screen.getAllByTestId("support")).toHaveLength(1); | ||
}); | ||
}); |
Oops, something went wrong.