package bootstrapimpl

import "testing"

func TestSystemTablesIncludeRemainingAuthoringKeyPrefixes(t *testing.T) {
	// PR-B intentionally locks only the admitted post-#550 authoring subset.
	want := map[string]string{
		"SharingRule":        "01q",
		"ProfileLayout":      "00h",
		"Dashboard":          "01Z",
		"DashboardComponent": "01a",
	}

	defs := GetSystemTableDefinitions()
	got := make(map[string]string, len(want))
	for _, def := range defs {
		if _, ok := want[def.TableName]; ok {
			got[def.TableName] = def.KeyPrefix
		}
	}

	for tableName, wantPrefix := range want {
		gotPrefix, ok := got[tableName]
		if !ok {
			t.Fatalf("%s missing from system_tables.json", tableName)
		}
		if gotPrefix != wantPrefix {
			t.Fatalf("%s keyPrefix = %q, want %q", tableName, gotPrefix, wantPrefix)
		}
	}
}
