import { Component, getAssetPath, h, Host } from '@stencil/core';
import { STORAGE_KEY_KIMLIK_TOKEN } from '@dvn/kimlik/api/kimlik-api';
/**
 * Given;
 *   user is logged in
 *   membership doesn't belong to the user
 * When;
 *  user visits the application
 * Then;
 *   not found page should be shown
 */
export class KhanguruUiTestMembershipActivation5 {
  render() {
    const assetsPath = getAssetPath(`./assets`);
    const space = {
      _id: 'acme-summer-camp',
      _created: new Date(),
      _updated: new Date(),
      name: 'Acme Summer Camp',
      logoUrl: `${assetsPath}/img/spaces/hexadrop.png`,
    };
    const teachersConfig = {
      _id: 'teachers',
      agreements: [],
      base: 'khanguru',
      fields: [],
      name: 'teachers-table',
      roleName: 'teacher',
      space,
    };
    const user = {
      _id: 'user_1',
      email: 'ata.turk@acme.com',
      firstName: 'Ata',
      lastName: 'Türk',
      status: 'active'
    };
    const database = {
      uyeMembershipConfigs: {
        'teachers': teachersConfig,
      },
      'teachers-table': {
        'teacher-1': {
          _id: 'teacher-1',
          config: teachersConfig,
          status: 'active',
          user,
        }
      },
      kimlikUsers: {
        'user_1': user
      },
      dvnAppConfigs: {
        'app-config-1': {
          mainContent: {
            centered: true,
          },
          mainNavigation: {
            items: []
          },
          membership: {
            _id: 'teachers'
          }
        }
      }
    };
    return (h(Host, { style: { overflow: 'auto' } },
      h("khanguru-ui-test-wrapper", { database: database, initialPath: "/acme-summer-camp/teachers/invalid-membership-id", testKey: "khanguru-ui-test-membership-activation-5", storageData: {
          [STORAGE_KEY_KIMLIK_TOKEN]: `${user._id}-token`
        } })));
  }
  static get is() { return "khanguru-ui-test-membership-activation-5"; }
  static get encapsulation() { return "scoped"; }
  static get assetsDirs() { return ["assets"]; }
}
