Skip to content

Commit

Permalink
fix: korjaa vuorovaikuttamisen käyttöliittymätesti sekä projektinTila…
Browse files Browse the repository at this point in the history
…-apikutsun käsittely (#551)
  • Loading branch information
haapamakim authored and mustonenk committed Jan 23, 2023
1 parent 9bae82f commit 82b1e83
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions common/abstractApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export const apiConfig: ApiConfig = {
name: "projektinTila",
operationType: OperationType.Query,
graphql: queries.projektinTila,
isYllapitoOperation: true,
},
listaaProjektit: {
name: "listaaProjektit",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ describe("Projektin suunnitteluvaihe (perustiedot)", () => {

it("Tallenna suunnitteluvaiheen vuorovaikutuksen tiedot ja julkaise", { scrollBehavior: "center" }, function () {
cy.login("A1");
cy.visit(Cypress.env("host") + "/yllapito/projekti/" + oid + "/suunnittelu/vuorovaikuttaminen/1");
cy.visit(Cypress.env("host") + "/yllapito/projekti/" + oid + "/suunnittelu/vuorovaikuttaminen");
cy.contains(projektiNimi);
cy.wait(2000);

Expand Down Expand Up @@ -239,7 +239,7 @@ describe("Projektin suunnitteluvaihe (perustiedot)", () => {
cy.get("#save_published_suunnitteluvaihe").click();
cy.get("#accept_publish").click();
cy.contains("Julkaisu onnistui");
cy.visit(Cypress.env("host") + "/yllapito/projekti/" + oid + "/suunnittelu/vuorovaikuttaminen/1");
cy.visit(Cypress.env("host") + "/yllapito/projekti/" + oid + "/suunnittelu/vuorovaikuttaminen");

cy.get("#add_or_edit_tilaisuus").click();

Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useProjektinTila.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export default function useIsProjektiReadyForTilaChange(projekti: Projekti) {

useInterval(
async () => {
let tila = await api.lataaProjektinTila(projekti.oid);
if (tila.aineistotValmiit) {
let tila = projekti?.oid ? await api.lataaProjektinTila(projekti.oid) : undefined;
if (tila?.aineistotValmiit) {
console.log("Aineistot valmiit");
setIsReady(true);
return false;
Expand Down

0 comments on commit 82b1e83

Please sign in to comment.