Skip to content

Commit

Permalink
star/unstar a juxtalinear project works now
Browse files Browse the repository at this point in the history
  • Loading branch information
danielc-n committed Apr 12, 2024
1 parent a0f4b91 commit 58605c8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
14 changes: 7 additions & 7 deletions renderer/src/components/hooks/projects/useProjectsSort.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ function useProjectsSort() {
const [loading, setLoading] = React.useState(false);
const [activeNotificationCount, setActiveNotificationCount] = React.useState(0);

const starrtedData = [];
const unstarrtedData = [];
const starredData = [];
const unstarredData = [];
const allProjects = [];

useEffect(() => {
Expand Down Expand Up @@ -233,10 +233,10 @@ function useProjectsSort() {
}
})
.then(() => {
setStarredRow(starrtedData);
setStarredProjets(starrtedData);
setUnStarredRow(unstarrtedData);
setUnStarredProjets(unstarrtedData);
setStarredRow(starredData);
setStarredProjets(starredData);
setUnStarredRow(unstarredData);
setUnStarredProjets(unstarredData);
setProjects(allProjects);
});
})
Expand All @@ -263,7 +263,6 @@ function useProjectsSort() {
if (_project.identification.name.en !== name) { return; }

const flavorName = _project.type.flavorType.flavor.name;
logger.debug('useProjectSort.js', `flavorName == ${flavorName}`);
const dirNameMap = {
textTranslation: 'textTranslation',
textStories: 'textStories',
Expand Down Expand Up @@ -300,6 +299,7 @@ function useProjectsSort() {
textTranslation: 'textTranslation',
textStories: 'textStories',
audioTranslation: 'audioTranslation',
'x-juxtalinear': 'x-juxtalinear',
};
return dirNameMap[flavorName];
};
Expand Down
16 changes: 8 additions & 8 deletions renderer/src/modules/projects/tests/ProjectsListtest.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@

// // describe('Starred content table test', () => {
// // test('Check each content in the starred row', () => {
// // render(intl(<Projects starrtedData={starrted} unstarrtedData={unstarrted} />));
// // render(intl(<Projects starredData={starrted} unstarredData={unstarrted} />));
// // const starredrowname = document.querySelector('#starredrow-name');
// // expect(starredrowname.textContent).toBe('English NIV');
// // const starredrowlanguage = document.querySelector('#starredrow-language');
Expand All @@ -127,7 +127,7 @@
// // });

// // test('Check for starrred rows gets unstarred', () => {
// // render(intl(<Projects starrtedData={starrted} unstarrtedData={unstarrted} />));
// // render(intl(<Projects starredData={starrted} unstarredData={unstarrted} />));
// // const starredrow = document.querySelector('#starredrow');
// // expect(starredrow.children.length).toBe(4);
// // const starredbutton = document.querySelector('#starredicon');
Expand All @@ -137,7 +137,7 @@

// // test('check for search state change', async () => {
// // const { getByTestId } = render(
// // intl(<Projects starrtedData={starrted} unstarrtedData={unstarrted} />),
// // intl(<Projects starredData={starrted} unstarredData={unstarrted} />),
// // );
// // const searchbox = getByTestId('searchfield');
// // await act(async () => {
Expand All @@ -148,7 +148,7 @@

// // test('Check content after search in the starred row', async () => {
// // const { getByTestId } = render(
// // intl(<Projects starrtedData={starrted} unstarrtedData={unstarrted} />),
// // intl(<Projects starredData={starrted} unstarredData={unstarrted} />),
// // );
// // const searchbox = getByTestId('searchfield');
// // await act(async () => {
Expand All @@ -167,7 +167,7 @@

// // describe('Unstarred content fields test', () => {
// // test('Check each content in the unstarred row', () => {
// // render(intl(<Projects starrtedData={starrted} unstarrtedData={unstarrted} />));
// // render(intl(<Projects starredData={starrted} unstarredData={unstarrted} />));
// // const unstarredrowname = document.querySelector('#unstarredrow-name');
// // expect(unstarredrowname.textContent).toBe('Arabic NIV');
// // const unstarredrowlanguage = document.querySelector(
Expand All @@ -180,7 +180,7 @@
// // expect(unstarredrowtime.textContent).toBe('2 months ago');
// // });
// // test('Check for unstarrred rows gets starred', () => {
// // render(intl(<Projects starrtedData={starrted} unstarrtedData={unstarrted} />));
// // render(intl(<Projects starredData={starrted} unstarredData={unstarrted} />));
// // const unstarredrow = document.querySelector('#unstarredrow');
// // expect(unstarredrow.children.length).toBe(5);
// // const unstarredbutton = document.querySelector('#unstarredicon');
Expand All @@ -190,7 +190,7 @@

// // test('Check content after search in the unstarred row', async () => {
// // const { getByTestId } = render(
// // intl(<Projects starrtedData={starrted} unstarrtedData={unstarrted} />),
// // intl(<Projects starredData={starrted} unstarredData={unstarrted} />),
// // );
// // const searchbox = getByTestId('searchfield');
// // await act(async () => {
Expand All @@ -211,7 +211,7 @@

// // describe('Sorting check', () => {
// // test('Check whether items gets sorted', () => {
// // render(intl(<Projects starrtedData={starrted} unstarrtedData={unstarrted} />));
// // render(intl(<Projects starredData={starrted} unstarredData={unstarrted} />));
// // const sortbar = document.querySelector('#sorthead');
// // fireEvent.click(sortbar);
// // const starredrowname = document.querySelector('#starredrow-name');
Expand Down

0 comments on commit 58605c8

Please sign in to comment.